Skip to content

Commit bd68dba

Browse files
authored
Update README.md
1 parent 7203649 commit bd68dba

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import React from "react";
99
1010
const KEY_UPDATE = "__update";
1111
12-
const useActions = ({ initialState, actions }) => {
12+
const useActions = (actions, initialState = {}) => {
1313
const keys = React.useMemo(() => {
1414
return Object.keys(actions());
1515
}, [actions]);
@@ -95,10 +95,7 @@ import useActions from "../../hooks/useActions";
9595
import { actions, initialState } from "./actions.js";
9696
9797
const Counter = ({ id }) => {
98-
const [{ count, loading }, { decrement, increment, getRandom }] = useActions({
99-
initialState,
100-
actions
101-
});
98+
const [{ count, loading }, { decrement, increment, getRandom }] = useActions(actions, initialState);
10299
103100
return (
104101
<div style={{ marginBottom: 20 }}>

0 commit comments

Comments
 (0)