Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/dash-os/reducer-generator-object-map
- Owner: Dash-OS
- License: mit
- Created: 2017-05-28T11:47:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-30T03:53:39.000Z (over 7 years ago)
- Last Synced: 2024-11-03T00:32:56.531Z (12 days ago)
- Topics: react, reducer-generator, redux, saga-process, saga-process-manager
- Language: JavaScript
- Homepage:
- Size: 91.8 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
reducer-generator-object-map
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?
Contributors
These amazing people have contributed code to this project:
License
Unless stated otherwise all works are:
- Copyright © Braden R. Napier
and licensed under: