diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-09 22:07:27 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-09 22:31:54 +0900 |
commit | e8056d2a709df9c9c182382fc7a31795e4dc1c0f (patch) | |
tree | 88bd6e0fe572138941e0986c11deeebd788370a7 /src/actions | |
parent | 8593b3f5cd0992dd250f5a845c19dc60bbb0bc91 (diff) |
console state as action/reducer in redux
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/console.js | 28 | ||||
-rw-r--r-- | src/actions/index.js | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/actions/console.js b/src/actions/console.js new file mode 100644 index 0000000..99a46e8 --- /dev/null +++ b/src/actions/console.js @@ -0,0 +1,28 @@ +import actions from '../actions'; + +export function showCommand(text) { + return { + type: actions.CONSOLE_SHOW_COMMAND, + text: text + }; +} + +export function setCompletions(completions) { + return { + type: actions.CONSOLE_SET_COMPLETIONS, + completions: completions + }; +} + +export function showError(text) { + return { + type: actions.CONSOLE_SHOW_ERROR, + text: text + }; +} + +export function hide() { + return { + type: actions.CONSOLE_HIDE + }; +} diff --git a/src/actions/index.js b/src/actions/index.js new file mode 100644 index 0000000..38ced9d --- /dev/null +++ b/src/actions/index.js @@ -0,0 +1,6 @@ +export default { + CONSOLE_SHOW_COMMAND: 'vimvixen.console.show.command', + CONSOLE_SET_COMPLETIONS: 'vimvixen.console.set.completions', + CONSOLE_SHOW_ERROR: 'vimvixen.console.show.error', + CONSOLE_HIDE: 'vimvixen.console.hide' +}; |