Skip to content

Commit

Permalink
Merge pull request #9 from FredyC/readme-fix-arguments
Browse files Browse the repository at this point in the history
fixed usage of undoable function in README
  • Loading branch information
omnidan committed Sep 23, 2015
2 parents 2b2f098 + e4a3b03 commit ccc559d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ A configuration object can be passed to `undoable()` like this (values shown
are default values):

```js
undoable({
undoable(reducer, {
limit: false, // set to a number to turn on a limit for the history

filter: () => true, // see `Filtering Actions` section
Expand All @@ -100,7 +100,7 @@ If you don't want to include every action in the undo/redo history, you can
pass a function to `undoable` like this:

```js
undoable(function filterActions(action) {
undoable(reducer, function filterActions(action) {
return action.type !== SOME_ACTION; // only undo/redo on SOME_ACTION
})
```
Expand All @@ -115,15 +115,15 @@ import undoable, { ifAction, excludeAction } from 'redux-undo';
Now you can use the helper, which is pretty simple:

```js
undoable({ filter: ifAction(SOME_ACTION) })
undoable({ filter: excludeAction(SOME_ACTION) })
undoable(reducer, { filter: ifAction(SOME_ACTION) })
undoable(reducer, { filter: excludeAction(SOME_ACTION) })
```

... they even support Arrays:

```js
undoable({ filter: ifAction([SOME_ACTION, SOME_OTHER_ACTION]) })
undoable({ filter: excludeAction([SOME_ACTION, SOME_OTHER_ACTION]) })
undoable(reducer, { filter: ifAction([SOME_ACTION, SOME_OTHER_ACTION]) })
undoable(reducer, { filter: excludeAction([SOME_ACTION, SOME_OTHER_ACTION]) })
```

Note that the helpers always accept `@@redux/INIT` too in order to store your
Expand Down

0 comments on commit ccc559d

Please sign in to comment.