From e4a3b0387561d2670f1998dcc41c96f1315e8e8b Mon Sep 17 00:00:00 2001 From: FredyC Date: Wed, 23 Sep 2015 12:12:10 +0200 Subject: [PATCH] fixed usage of undoable function in README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 643cc46..017d8b8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 }) ``` @@ -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