UNPKG
add-component
Version:
latest (2.5.0)
2.5.0
2.4.1
2.4.0
2.3.0
2.2.0
2.1.1
2.1.0
2.0.0
Create React Component CLI
github.com/hanford/add-component
hanford/add-component
add-component
/
templates
/
reducer.js
22 lines
(16 loc)
•
302 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import
t
from
'./actionTypes'
const
defaultState = {
count
:
0
, }
const
counter
= (
state = defaultState, action
) => {
switch
(action.
type
) {
case
t.
INCREMENT
:
return
{ ...state,
count
: state.
count
+
1
}
default
:
return
state } }
export
default
users