rename to follow-controller
This commit is contained in:
parent
24c7369451
commit
2c600786c8
9 changed files with 107 additions and 106 deletions
|
@ -8,21 +8,21 @@ const defaultState = {
|
|||
|
||||
export default function reducer(state = defaultState, action = {}) {
|
||||
switch (action.type) {
|
||||
case actions.FOLLOW_ENABLE:
|
||||
case actions.FOLLOW_CONTROLLER_ENABLE:
|
||||
return Object.assign({}, state, {
|
||||
enabled: true,
|
||||
newTab: action.newTab,
|
||||
keys: '',
|
||||
});
|
||||
case actions.FOLLOW_DISABLE:
|
||||
case actions.FOLLOW_CONTROLLER_DISABLE:
|
||||
return Object.assign({}, state, {
|
||||
enabled: false,
|
||||
});
|
||||
case actions.FOLLOW_KEY_PRESS:
|
||||
case actions.FOLLOW_CONTROLLER_KEY_PRESS:
|
||||
return Object.assign({}, state, {
|
||||
keys: state.keys + action.key,
|
||||
});
|
||||
case actions.FOLLOW_BACKSPACE:
|
||||
case actions.FOLLOW_CONTROLLER_BACKSPACE:
|
||||
return Object.assign({}, state, {
|
||||
keys: state.keys.slice(0, -1),
|
||||
});
|
|
@ -1,14 +1,14 @@
|
|||
import addonReducer from './addon';
|
||||
import settingReducer from './setting';
|
||||
import inputReducer from './input';
|
||||
import followReducer from './follow';
|
||||
import followControllerReducer from './follow-controller';
|
||||
|
||||
// Make setting reducer instead of re-use
|
||||
const defaultState = {
|
||||
addon: addonReducer(undefined, {}),
|
||||
setting: settingReducer(undefined, {}),
|
||||
input: inputReducer(undefined, {}),
|
||||
follow: followReducer(undefined, {}),
|
||||
followController: followControllerReducer(undefined, {}),
|
||||
};
|
||||
|
||||
export default function reducer(state = defaultState, action = {}) {
|
||||
|
@ -16,6 +16,6 @@ export default function reducer(state = defaultState, action = {}) {
|
|||
addon: addonReducer(state.addon, action),
|
||||
setting: settingReducer(state.setting, action),
|
||||
input: inputReducer(state.input, action),
|
||||
follow: followReducer(state.follow, action),
|
||||
followController: followControllerReducer(state.followController, action),
|
||||
});
|
||||
}
|
||||
|
|
Reference in a new issue