Skip to content

Commit 518cf42

Browse files
sppiotrowskitimche
authored andcommitted
add missing round brackets
I am afraid that those round brackets are necessary to run an example.
1 parent 33d6443 commit 518cf42

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/introduction/Tutorial.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ const decrement = createAction('DECREMENT');
127127
Instead of using `handleAction` like we did for `increment`, we can replace it with our other tool `handleActions` which will let us handle both `increment` and `decrement` actions.
128128

129129
```js
130-
const {
131-
createAction,
132-
handleActions
133-
} = window.ReduxActions;
134-
135-
const reducer = handleActions({
136-
[increment]: (state) => ({ ...state, counter: state.counter + 1 },
137-
[decrement]: (state) => ({ ...state, counter: state.counter - 1 },
138-
}, defaultState);
130+
const { createAction, handleActions } = window.ReduxActions;
131+
132+
const reducer = handleActions(
133+
{
134+
[increment]: state => ({ ...state, counter: state.counter + 1 }),
135+
[decrement]: state => ({ ...state, counter: state.counter - 1 })
136+
},
137+
defaultState
138+
);
139139
```
140140

141141
Now when we add a handler for dispatching our `decrement` action we can see both `increment` and `decrement` buttons now function appropriately.

0 commit comments

Comments
 (0)