From 567b696cecbec870c36f5a07dd02fb5d9f9efb9b Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 30 Sep 2017 22:51:18 +0900 Subject: redux in console --- src/actions/completion.js | 22 ++++++++++++++++++++++ src/actions/index.js | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 src/actions/completion.js (limited to 'src/actions') diff --git a/src/actions/completion.js b/src/actions/completion.js new file mode 100644 index 0000000..1ffb025 --- /dev/null +++ b/src/actions/completion.js @@ -0,0 +1,22 @@ +import actions from '../actions'; + +const setItems = (groups) => { + return { + type: actions.COMPLETION_SET_ITEMS, + groups, + }; +}; + +const selectNext = () => { + return { + type: actions.COMPLETION_SELECT_NEXT + }; +}; + +const selectPrev = () => { + return { + type: actions.COMPLETION_SELECT_PREV + }; +}; + +export { setItems, selectNext, selectPrev }; diff --git a/src/actions/index.js b/src/actions/index.js index 7b79864..2aa28fa 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -9,4 +9,9 @@ export default { INPUT_KEY_PRESS: 'input.key,press', INPUT_CLEAR_KEYS: 'input.clear.keys', INPUT_SET_KEYMAPS: 'input.set,keymaps', + + // Completion + COMPLETION_SET_ITEMS: 'completion.set.items', + COMPLETION_SELECT_NEXT: 'completions.select.next', + COMPLETION_SELECT_PREV: 'completions.select.prev' }; -- cgit v1.2.3