key input sequence as action/reducer
This commit is contained in:
parent
adc6a5175c
commit
879b5afe66
9 changed files with 135 additions and 127 deletions
|
@ -29,4 +29,8 @@ export default {
|
|||
FOLLOW_START: 'follow.start',
|
||||
HISTORY_PREV: 'history.prev',
|
||||
HISTORY_NEXT: 'history.next',
|
||||
|
||||
// User input
|
||||
INPUT_KEY_PRESS: 'input.key,press',
|
||||
INPUT_CLEAR_KEYS: 'input.clear.keys',
|
||||
};
|
||||
|
|
15
src/actions/input.js
Normal file
15
src/actions/input.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import actions from '../actions';
|
||||
|
||||
export function keyPress(code, ctrl) {
|
||||
return {
|
||||
type: actions.INPUT_KEY_PRESS,
|
||||
code,
|
||||
ctrl
|
||||
};
|
||||
}
|
||||
|
||||
export function clearKeys() {
|
||||
return {
|
||||
type: actions.INPUT_CLEAR_KEYS
|
||||
}
|
||||
}
|
Reference in a new issue