0.0.50 • Published 4 years ago
redux-hot-module v0.0.50
redux-hot-module
under development
Installation
npm
npm i redux-hot-module
yarn
yarn add redux-hot-module
Usage
import { ReduxHotModule } from 'redux-hot-module'
// cached or mocked state that will be merged in (optional)
const preloadedState = localStorage.getItem('searchResults')
const ml = new ReduxHotModule('searchResults', preloadedState)
// param actions
ml.addParamAction('posts', [])
ml.addParamAction('selectedPost', null)
ml.addParamAction('pageNumber', 1)
ml.addParamAction('pageSize', 10)
ml.addParamAction('loading', false)
ml.addParamAction('hasNext', false)
// event actions
ml.addEventAction('loadNextEvent')
// reset action
ml.addResetAction('reset')
export const {
namespace,
reducer,
defaultState,
initialState,
withModuleProps,
mapStateToProps,
mapDispatchToProps,
types: {
SEARCH_RESULTS_POSTS,
SEARCH_RESULTS_SELECTED_POST,
SEARCH_RESULTS_PAGE_NUMBER,
SEARCH_RESULTS_PAGE_SIZE,
SEARCH_RESULTS_LOADING,
SEARCH_RESULTS_HAS_NEXT,
SEARCH_RESULTS_LOAD_NEXT_EVENT,
SEARCH_RESULTS_RESET
},
actions: {
postsAction,
selectedPostAction,
pageNumberAction,
pageSizeAction,
loadingAction,
hasNextAction,
loadNextEventAction,
resetAction
}
} = ml.create()
unpkg
Global name: ReduxHotModule
Requires 'react-redux' package with 'ReactRedux' global name
https://github.com/reduxjs/react-redux
https://cdnjs.com/libraries/react-redux
<script src="https://unpkg.com/redux-hot-module@latest/lib/bundle.umd.js"></script>
0.0.50
4 years ago
0.0.49
4 years ago
0.0.48
4 years ago
0.0.47
4 years ago
0.0.46
4 years ago
0.0.44
4 years ago
0.0.45
4 years ago
0.0.43
4 years ago
0.0.41
4 years ago
0.0.42
4 years ago
0.0.40
4 years ago
0.0.38
4 years ago
0.0.39
4 years ago
0.0.37
4 years ago
0.0.36
4 years ago
0.0.35
4 years ago
0.0.34
4 years ago
0.0.32
4 years ago
0.0.33
4 years ago
0.0.30
4 years ago
0.0.31
4 years ago
0.0.29
4 years ago
0.0.26
4 years ago
0.0.27
4 years ago
0.0.28
4 years ago
0.0.25
4 years ago
0.0.23
4 years ago
0.0.24
4 years ago
0.0.22
4 years ago
0.0.21
4 years ago
0.0.20
4 years ago
0.0.19
4 years ago
0.0.17
4 years ago
0.0.18
4 years ago
0.0.15
4 years ago
0.0.16
4 years ago
0.0.12
4 years ago
0.0.13
4 years ago
0.0.14
4 years ago
0.0.10
4 years ago
0.0.11
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.7
4 years ago
0.0.1
4 years ago