We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a557058 commit dcff08bCopy full SHA for dcff08b
1 file changed
README.md
@@ -11,7 +11,7 @@
11
[](https://codecov.io/github/ctrlplusb/easy-peasy)
12
13
```javascript
14
-import { StoreProvider, createStore, useStore, useAction } from 'easy-peasy';
+import { StoreProvider, createStore, useStore, useActions } from 'easy-peasy';
15
16
// 👇 create your store, providing the model
17
const store = createStore({
@@ -36,7 +36,7 @@ const App = () => (
36
function TodoList() {
37
// 👇 use hooks to get state or actions
38
const todos = useStore(state => state.todos.items)
39
- const add = useAction(dispatch => dispatch.todos.add)
+ const add = useActions(actions => actions.todos.add)
40
return (
41
<div>
42
{todos.map((todo, idx) => <div key={idx}>{todo}</div>)}
0 commit comments