completion as action/reducer
This commit is contained in:
parent
7e35d11f65
commit
3c67cc0a00
8 changed files with 75 additions and 47 deletions
|
@ -1,4 +1,5 @@
|
|||
import './console.scss';
|
||||
import * as backgroundActions from '../actions/background';
|
||||
import Completion from './completion';
|
||||
import consoleReducer from '../reducers/console';
|
||||
|
||||
|
@ -21,13 +22,6 @@ const keydownMessage = (input) => {
|
|||
};
|
||||
};
|
||||
|
||||
const keyupMessage = (input) => {
|
||||
return {
|
||||
type: 'vimvixen.command.change',
|
||||
value: input.value
|
||||
};
|
||||
};
|
||||
|
||||
const handleBlur = () => {
|
||||
return browser.runtime.sendMessage(blurMessage());
|
||||
};
|
||||
|
@ -88,7 +82,9 @@ const handleKeyup = (e) => {
|
|||
return;
|
||||
}
|
||||
prevValue = e.target.value;
|
||||
return browser.runtime.sendMessage(keyupMessage(e.target));
|
||||
return browser.runtime.sendMessage(
|
||||
backgroundActions.requestCompletions(e.target.value)
|
||||
);
|
||||
};
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
|
|
Reference in a new issue