Skip to content

Commit bad3427

Browse files
committed
fixed small bug in reducers
1 parent 6737cea commit bad3427

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/reducers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
const initialState = {code: ``}
2-
const rootReducer = (state = initialState, action) => {
1+
const initialState = { code: '' };
2+
const rootReducer = (action, state = initialState) => {
33
switch (action.type) {
44
case 'CODE':
55
return { ...state, code: action.payload };
66
case 'ADD_CHILD':
77
return { ...state, child: action.payload };
8-
case 'RESET_STATE':
9-
return {...state, code: {} };
8+
case 'RESET_STATE':
9+
return { ...state, code: {} };
1010
default:
1111
return state;
1212
}

0 commit comments

Comments
 (0)