nesting-reducer

1.0.1 • Public • Published

nesting-reducer

=========================

What is it

nesting-reducer is used for combine reducer as a nesting structure.

we aways use redux's to combineReducers, and we lost the big picture of state tree.

if u use nesting-reducer u can nesting-combine the reducers.

Install

npm install nesting-reducer

How to Use

  import {nestCombineReducers, handleActionsReducor, defaultStateReducor,
  actionPayloadReducer} from 'nesting-reducer';

 let stateTree = {
  config: {
    lng: handleActionsReducor('en-US', handleActionsObject)
  },

  user: {
    friend: {
      tag: handleActionsReducor([], handleActionsObject),
      list: handleActionsReducor([], handleActionsObject)
    },
    current: handleActionsReducor(null, handleActionsObject)
  },
 }

 let rootReducer = nestCombineReducers(stateTree);

Readme

Keywords

none

Package Sidebar

Install

npm i nesting-reducer

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • alex-zhang