Use official redux on content
This commit is contained in:
parent
cf0dcf2522
commit
efa1cb3967
11 changed files with 36 additions and 103 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Reference in a new issue