1.0.3 • Published 10 years ago

@micro-js/combine-reducers v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 years ago

combine-reducers

Build status Git tag NPM version Code style

Combines an object of reducers together to form a single, composite reducer. This function is identical to the one provided by https://github.com/rackt/redux but it doesn't do the sanity checks that redux does, which allows you to do a few things like having multiple root reducers combined into one that you can't do with redux's assertions.

Installation

$ npm install @micro-js/combine-reducers

Usage

var combineReducers = require('@micro-js/combine-reducers')

combineReducers({
  counter1: counterReducer,
  counter2: counterReducer
})

function counterReducer (state, action) {
  if (action.type === INCREMENT) {
    return ++state
  }

  return state
}

API

combineReducers(reducers)

  • reducers - An object containing a map of reducers to property names

Returns: The combined reducer map as a single reducing function.

License

MIT

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago