focal-redux
v0.0.1
Published
Downloads
3
Readme
Focal-Redux
Focal-Redux
allows you to use all the power of Focal in a Redux application.
It helps you to implement Focal's Atom
in the Redux application by simplifying the code refactoring when you want to switch from Redux to Focal.
Futhermore, you can use all the advantages of both state-management in your application.
For example, Focal can help you with large collections of data or form management, and so on.
Installation
$ yarn add focal-redux
or
$ npm install --save focal-redux
Usage
First Step
You should wrap your Reducer
or ReducersMapObject
with subscribeAtom
function.
This function will automaticaly add action @@UPDATE_STORE@@
which will be dispatched when your atom updates.
import {subscribeStore} from 'focal-redux'
// Reducer:
subscribeAtom(reducer)
// ReducersMapObject
combineReducer(subscribeAtom({ //reducers }))
First Step
You should subscribe your atom to store using subscribeStore
function:
subscribeStore(atom, store)
NPM scripts
npm start
: Runsnpm run build
in watch modenpm run test
: Run test suitenpm run test:watch
: Run test suite in interactive watch modenpm run build
: Generage bundles and typingsnpm run lint
: Lints code
Contributing
If you think that we are missing any key features, please open a GitHub issue, or even better, a pull request. Any feedback you have about using focal-redux
would be greatly appreciated.