Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dash-os/reducer-generator-object-map

A reducer-generator that builds a redux-reducer which matches against object literals.
https://github.com/dash-os/reducer-generator-object-map

react reducer-generator redux saga-process saga-process-manager

Last synced: 6 days ago
JSON representation

A reducer-generator that builds a redux-reducer which matches against object literals.

Awesome Lists containing this project

README

        

reducer-generator-object-map

NPM version
NPM downloads
Dependency Status
Travis CI Build Status
Coveralls Coverage Status
PayPal donate button

A redux reducer-generator that builds a redux-reducer which matches against object literals.

> You may pass extra arguments when creating the reducer and when reducing.
> The resulting arguments will be `(...initialArgs, ...reducerArgs)`.

### Installation

```
yarn add reducer-generator-object-map
```

**or**

```
npm install --save reducer-generator-object-map
```

### Simple Example

```js
import createObjectMapReducer from 'reducer-generator-object-map'

const system = createObjectMapReducer({ /* initial state */ }, {
'SYSTEM_ONLINE': (state, { type, ...action }, ...extraArgs) => ({
...state,
isOnline: true
}),
'SYSTEM_OFFLINE': (state, { type, ...action }, ...extraArgs) => ({
...state,
isOnline: false
})
}, /* You may pass extra args that will be passed to the reducer(s) */ )
```

History

Discover the release history by heading on over to the releases page.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

PayPal donate button

Contributors

These amazing people have contributed code to this project:

License

Unless stated otherwise all works are:

  • Copyright © Braden R. Napier

and licensed under: