0.0.50 • Published 5 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
5 years ago
0.0.49
5 years ago
0.0.48
5 years ago
0.0.47
5 years ago
0.0.46
5 years ago
0.0.44
6 years ago
0.0.45
6 years ago
0.0.43
6 years ago
0.0.41
6 years ago
0.0.42
6 years ago
0.0.40
6 years ago
0.0.38
6 years ago
0.0.39
6 years ago
0.0.37
6 years ago
0.0.36
6 years ago
0.0.35
6 years ago
0.0.34
6 years ago
0.0.32
6 years ago
0.0.33
6 years ago
0.0.30
6 years ago
0.0.31
6 years ago
0.0.29
6 years ago
0.0.26
6 years ago
0.0.27
6 years ago
0.0.28
6 years ago
0.0.25
6 years ago
0.0.23
6 years ago
0.0.24
6 years ago
0.0.22
6 years ago
0.0.21
6 years ago
0.0.20
6 years ago
0.0.19
6 years ago
0.0.17
6 years ago
0.0.18
6 years ago
0.0.15
6 years ago
0.0.16
6 years ago
0.0.12
6 years ago
0.0.13
6 years ago
0.0.14
6 years ago
0.0.10
6 years ago
0.0.11
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.7
6 years ago
0.0.1
6 years ago