main
js 14 lines 372 Bytes
Raw
1 import {createStore} from 'redux';
2
3 function reducer(state = 0, action) {
4 switch (action.type) {
5 case 'increment':
6 return state + 1;
7 default:
8 return state;
9 }
10 }
11
12 // Because this file is declared above both Modern and Legacy folders,
13 // we can import this from either folder without duplicating the object.
14 export const store = createStore(reducer);