completion as action/reducer
This commit is contained in:
parent
7e35d11f65
commit
3c67cc0a00
8 changed files with 75 additions and 47 deletions
11
src/actions/background.js
Normal file
11
src/actions/background.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import actions from '../actions';
|
||||
|
||||
export function requestCompletions(line) {
|
||||
let command = line.split(' ', 1)[0];
|
||||
let keywords = line.replace(command + ' ', '');
|
||||
return {
|
||||
type: actions.BACKGROUND_REQUEST_COMPLETIONS,
|
||||
command,
|
||||
keywords
|
||||
};
|
||||
}
|
|
@ -2,5 +2,7 @@ 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'
|
||||
CONSOLE_HIDE: 'vimvixen.console.hide',
|
||||
|
||||
BACKGROUND_REQUEST_COMPLETIONS: 'vimvixen.background.request.completions'
|
||||
};
|
||||
|
|
Reference in a new issue