use createStore short-hand method

This commit is contained in:
Shin'ya Ueoka 2017-10-04 21:30:57 +09:00
parent 482206f6c9
commit 6594841b1d
4 changed files with 26 additions and 26 deletions

View file

@ -3,16 +3,16 @@ import * as consoleFrames from './console-frames';
import * as scrolls from '../content/scrolls';
import * as navigates from '../content/navigates';
import * as followActions from '../actions/follow';
import * as store from '../store';
import { createStore } from '../store';
import ContentInputComponent from '../components/content-input';
import FollowComponent from '../components/follow';
import followReducer from '../reducers/follow';
import operations from '../operations';
import messages from './messages';
const followStore = store.createStore(followReducer);
const followComponent = new FollowComponent(window.document.body, followStore);
followStore.subscribe(() => {
const store = createStore(followReducer);
const followComponent = new FollowComponent(window.document.body, store);
store.subscribe(() => {
try {
followComponent.update();
} catch (e) {
@ -39,7 +39,7 @@ const execOperation = (operation) => {
case operations.SCROLL_END:
return scrolls.scrollRight(window);
case operations.FOLLOW_START:
return followStore.dispatch(followActions.enable(false));
return store.dispatch(followActions.enable(false));
case operations.NAVIGATE_HISTORY_PREV:
return navigates.historyPrev(window);
case operations.NAVIGATE_HISTORY_NEXT: