Enable build support by adding .onedev-buildspec.yml
| .github | Loading last commit info... | |
| src | ||
| test | ||
| .editorconfig | ||
| .gitignore | ||
| .npmignore | ||
| .travis.yml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| package.json | ||
| rollup.config.js |
README.md
@vslutov/redux-flux
Redux utils to remove boilerplate code
Install
npm install @vslutov/redux-flux
Code example
import { createFlux, applySelectors, bindActionCreators } from '@vslutov/redux-flux'
import { createStore, combineReducers } from 'redux'
const { setActions, themePropertiesReducer, defaultSelectors } = createFlux({
prefix: 'THEME_PROPERTIES',
defaultValues: {
fontSize: 8,
color: 'blue'
}
})
const store = createStore(combineReducers({
themeProperties: themePropertiesReducer
}))
t.is(defaultSelectors.fontSize(store.getState()), 8)
const actions = bindActionCreators(setActions, store.dispatch)
await actions.setFontSize(10)
t.is(defaultSelectors.fontSize(store.getState()), 10)
const prop = applySelectors(defaultSelectors)(store.getState())
t.deepEqual(prop, {
fontSize: 10,
color: 'blue'
})