Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 17da4f9

Browse files
authored
Update README.md
1 parent 8867654 commit 17da4f9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import { useEffectReducer } from 'use-effect-reducer';
7474
// I know, I know, yet another counter example
7575
const countReducer = (state, event, exec) => {
7676
switch (event.type) {
77-
case 'ADD':
77+
case 'INC':
7878
exec(() => {
7979
// "Execute" a side-effect here
8080
console.log('Going up!');
@@ -93,7 +93,12 @@ const countReducer = (state, event, exec) => {
9393
const App = () => {
9494
const [state, dispatch] = useEffectReducer(countReducer, { count: 0 });
9595

96-
return <div>Count: {state.count}</div>;
96+
return <div>
97+
<output>Count: {state.count}</output>
98+
<button onClick={() => dispatch('INC')}>
99+
Increment
100+
</button>
101+
</div>;
97102
};
98103
```
99104

0 commit comments

Comments
 (0)