Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "reducify", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Make reducers with less effort.", | ||
@@ -5,0 +5,0 @@ "main": "lib/reducify.js", |
@@ -59,3 +59,2 @@ # Reducify [![Build Status](https://travis-ci.org/gtg092x/reducify.svg?branch=master)](https://travis-ci.org/gtg092x/reducify) | ||
```js | ||
function myReducer(state, action) { | ||
@@ -77,3 +76,2 @@ switch(action.type) { | ||
```js | ||
const myConfig = { | ||
@@ -94,3 +92,2 @@ defaultsTo: 10 | ||
```js | ||
const myArrayConfig = [ | ||
@@ -113,13 +110,40 @@ 10, | ||
`[10, myReducerFunction]` === `{defaultsTo: 10, reducer: myReducerFunction}` | ||
```js | ||
// No Select | ||
`[{myCount: 10}, 'myCount', myReducerFunction]` === `{defaultsTo: {myCount: 10}, select: 'myCount', reducer: myReducerFunction}` | ||
[10, myReducerFunction] | ||
`[{myCount: 10}, state => state.myCount, (result, state) => {...state, myCount: result}, myReducerFunction]` | ||
// Same as: | ||
{defaultsTo: 10, reducer: myReducerFunction} | ||
is the same as: | ||
`{defaultsTo: {myCount: 10}, select: state => state.myCount, merge: (result, state) => {...state, myCount: result}, reducer: myReducerFunction}` | ||
// Key Select | ||
[{myCount: 10}, 'myCount', myReducerFunction] | ||
// Same as: | ||
{defaultsTo: {myCount: 10}, select: 'myCount', reducer: myReducerFunction} | ||
// Long form select | ||
[ | ||
{myCount: 10}, | ||
state => state.myCount, | ||
(result, state) => {...state, myCount: result}, | ||
myReducerFunction | ||
] | ||
// Same as: | ||
{ | ||
defaultsTo: {myCount: 10}, | ||
select: state => state.myCount, | ||
merge: (result, state) => {...state, myCount: result}, | ||
reducer: myReducerFunction | ||
} | ||
``` | ||
## Configuration Sugar | ||
@@ -126,0 +150,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96301
16
1318
478