aboutsummaryrefslogtreecommitdiff
path: root/src/background/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/index.js')
-rw-r--r--src/background/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/background/index.js b/src/background/index.js
index e72cab0..ab99d39 100644
--- a/src/background/index.js
+++ b/src/background/index.js
@@ -1,9 +1,15 @@
import * as keys from './keys';
import * as inputActions from '../actions/input';
+import * as operationActions from '../actions/operation';
import backgroundReducers from '../reducers/background';
import commandReducer from '../reducers/command';
import inputReducers from '../reducers/input';
+import * as store from '../store'
+const emptyReducer = (state, action) => state;
+const emptyStore = store.createStore(emptyReducer, (e) => {
+ console.error('Vim-Vixen:', e);
+});
let inputState = inputReducers(undefined, {});
const keyQueueChanged = (sender, prevState, state) => {
@@ -21,6 +27,9 @@ const keyQueueChanged = (sender, prevState, state) => {
return Promise.resolve();
}
let action = keys.defaultKeymap[matched];
+ emptyStore.dispatch(operationActions.exec(action, sender), (e) => {
+ console.error('Vim-Vixen:', e);
+ });
return handleMessage(inputActions.clearKeys(), sender).then(() => {
return backgroundReducers(undefined, action, sender).then(() => {
return browser.tabs.sendMessage(sender.tab.id, action);