Skip to content

Commit a53eaf2

Browse files
committed
main 🧊 fix locale storage, add api for use mutate
1 parent db432aa commit a53eaf2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

‎src/hooks/useAsync/useAsync.demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const getPokemon = (id: number) =>
1212

1313
const Demo = () => {
1414
const counter = useCounter(1);
15-
const getPokemonQuery = useAsync(() => getPokemon(counter.value), [counter.value]});
15+
const getPokemonQuery = useAsync(() => getPokemon(counter.value), [counter.value]);
1616

1717
return (
1818
<>
19-
<button type='button' disabled={counter.count === 1} onClick={() => counter.dec()}>
19+
<button type='button' disabled={counter.value === 1} onClick={() => counter.dec()}>
2020
Prev
2121
</button>
2222
<button type='button' onClick={() => counter.inc()}>

‎src/hooks/useClickOutside/useClickOutside.demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ const Demo = () => {
2121
flexDirection: 'column',
2222
justifyContent: 'center',
2323
alignItems: 'center',
24-
border: `1px solid ${counter.count < 5 ? 'red' : 'green'}`
24+
border: `1px solid ${counter.value < 5 ? 'red' : 'green'}`
2525
}}
2626
>
2727
<p>Click more than 5 times:</p>
2828
<p>
29-
<code>{counter.count}</code>
29+
<code>{counter.value}</code>
3030
</p>
3131
</div>
3232
);

‎src/hooks/usePageLeave/usePageLeave.demo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { useCounter } from '../useCounter/useCounter';
33
import { usePageLeave } from './usePageLeave';
44

55
const Demo = () => {
6-
const { count, inc } = useCounter(0);
6+
const counter = useCounter(0);
77

8-
const isLeft = usePageLeave(() => inc());
8+
const isLeft = usePageLeave(() => counter.inc());
99

1010
return (
1111
<>
1212
<p>
1313
Mouse left the page: <code>{String(isLeft)}</code>
1414
</p>
15-
<p>Count of left the page {count} times</p>
15+
<p>Count of left the page {counter.value} times</p>
1616
</>
1717
);
1818
};

0 commit comments

Comments
 (0)