Use official redux on content

This commit is contained in:
Shin'ya Ueoka 2018-07-07 22:05:22 +09:00
parent cf0dcf2522
commit efa1cb3967
11 changed files with 36 additions and 103 deletions

View file

@ -6,15 +6,9 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) {
switch (action.type) {
case actions.ADDON_ENABLE:
case actions.ADDON_SET_ENABLED:
return { ...state,
enabled: true, };
case actions.ADDON_DISABLE:
return { ...state,
enabled: false, };
case actions.ADDON_TOGGLE_ENABLED:
return { ...state,
enabled: !state.enabled, };
enabled: action.enabled, };
default:
return state;
}