nice-store
v1.1.5
Published
lite & flexible & extensible state management for react
Downloads
34
Maintainers
Readme
nice-store
homepage
https://frontlich.github.io/nice-store/#/
usage
install
npm install nice-store
createCoreStore
import { createCoreStore } from "nice-store";
const store = createCoreStore(0);
store.subscribe(console.log);
store.setState(1); // will log 1
store.getState(); // 1
createStore
import { createStore } from "nice-store";
create enhanced store with initialState and enhancers
createStore(initialState, ...enhancers);
internal enhancers:
- async(asyncFn, 'takeLatest' | 'takeEvery')
- asyncLoading()
- connect(...otherStores)
- reducer(reducerFn)
- reset()
- selectorHook()
- task(taskFn)
- thunk(thunkFn)
other enhancers: