UNPKG
@selemondev/create-react-next
Version:
latest (1.0.4)
1.0.4
1.0.3
1.0.2
The Next Generation React Scaffolding Tool ✨
@selemondev/create-react-next
/
template
/
react-js
/
src
/
store
/
store.js
10 lines
(7 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{ create }
from
'zustand'
const
useStore =
create
(
(
set
) =>
({
count
:
0
,
incrementCount
:
() =>
set
(
(
state
) =>
({
count
: state.
count
+
1
})),
decrementCount
:
() =>
set
(
(
state
) =>
({
count
: state.
count
-
1
})),
resetCount
:
() =>
set
({
count
:
0
}), }))