Initial commit from boilerplate
This commit is contained in:
22
app/reducers/counter.js
Normal file
22
app/reducers/counter.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as types from '../actions/actionTypes';
|
||||
|
||||
const initialState = {
|
||||
count: 0
|
||||
};
|
||||
|
||||
export default function counter(state = initialState, action = {}) {
|
||||
switch (action.type) {
|
||||
case types.INCREMENT:
|
||||
return {
|
||||
...state,
|
||||
count: state.count + 1
|
||||
};
|
||||
case types.DECREMENT:
|
||||
return {
|
||||
...state,
|
||||
count: state.count - 1
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
5
app/reducers/index.js
Normal file
5
app/reducers/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import counter from './counter';
|
||||
|
||||
export {
|
||||
counter
|
||||
};
|
Reference in New Issue
Block a user