diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-19 09:34:40 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-05-19 09:34:40 +0900 |
commit | 4be04628e19392d8da9688d538cc3374e91005d8 (patch) | |
tree | 5c2299f6b85bf96dc9df65ddd7c27aef01b0ed69 /src/content/reducers | |
parent | e0c4182f14f908d13c8c814c7bc2b48a1791f881 (diff) |
Remove unused components
Diffstat (limited to 'src/content/reducers')
-rw-r--r-- | src/content/reducers/follow-controller.ts | 40 | ||||
-rw-r--r-- | src/content/reducers/index.ts | 15 | ||||
-rw-r--r-- | src/content/reducers/input.ts | 26 | ||||
-rw-r--r-- | src/content/reducers/mark.ts | 27 |
4 files changed, 0 insertions, 108 deletions
diff --git a/src/content/reducers/follow-controller.ts b/src/content/reducers/follow-controller.ts deleted file mode 100644 index 6965704..0000000 --- a/src/content/reducers/follow-controller.ts +++ /dev/null @@ -1,40 +0,0 @@ -import * as actions from '../actions'; - -export interface State { - enabled: boolean; - newTab: boolean; - background: boolean; - keys: string, -} - -const defaultState: State = { - enabled: false, - newTab: false, - background: false, - keys: '', -}; - -export default function reducer( - state: State = defaultState, - action: actions.FollowAction, -): State { - switch (action.type) { - case actions.FOLLOW_CONTROLLER_ENABLE: - return { ...state, - enabled: true, - newTab: action.newTab, - background: action.background, - keys: '', }; - case actions.FOLLOW_CONTROLLER_DISABLE: - return { ...state, - enabled: false, }; - case actions.FOLLOW_CONTROLLER_KEY_PRESS: - return { ...state, - keys: state.keys + action.key, }; - case actions.FOLLOW_CONTROLLER_BACKSPACE: - return { ...state, - keys: state.keys.slice(0, -1), }; - default: - return state; - } -} diff --git a/src/content/reducers/index.ts b/src/content/reducers/index.ts deleted file mode 100644 index 812a404..0000000 --- a/src/content/reducers/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { combineReducers } from 'redux'; -import input, { State as InputState } from './input'; -import followController, { State as FollowControllerState } - from './follow-controller'; -import mark, { State as MarkState } from './mark'; - -export interface State { - input: InputState; - followController: FollowControllerState; - mark: MarkState; -} - -export default combineReducers({ - input, followController, mark, -}); diff --git a/src/content/reducers/input.ts b/src/content/reducers/input.ts deleted file mode 100644 index 800a8f0..0000000 --- a/src/content/reducers/input.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as actions from '../actions'; -import Key from '../domains/Key'; - -export interface State { - keys: Key[], -} - -const defaultState: State = { - keys: [] -}; - -export default function reducer( - state: State = defaultState, - action: actions.InputAction, -): State { - switch (action.type) { - case actions.INPUT_KEY_PRESS: - return { ...state, - keys: state.keys.concat([action.key]), }; - case actions.INPUT_CLEAR_KEYS: - return { ...state, - keys: [], }; - default: - return state; - } -} diff --git a/src/content/reducers/mark.ts b/src/content/reducers/mark.ts deleted file mode 100644 index a8f2f1b..0000000 --- a/src/content/reducers/mark.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as actions from '../actions'; - -export interface State { - setMode: boolean; - jumpMode: boolean; -} - -const defaultState: State = { - setMode: false, - jumpMode: false, -}; - -export default function reducer( - state: State = defaultState, - action: actions.MarkAction, -): State { - switch (action.type) { - case actions.MARK_START_SET: - return { ...state, setMode: true }; - case actions.MARK_START_JUMP: - return { ...state, jumpMode: true }; - case actions.MARK_CANCEL: - return { ...state, setMode: false, jumpMode: false }; - default: - return state; - } -} |