equal
deleted
inserted
replaced
4 import { createStore, applyMiddleware, compose } from 'redux'; |
4 import { createStore, applyMiddleware, compose } from 'redux'; |
5 import { routerMiddleware } from 'react-router-redux'; |
5 import { routerMiddleware } from 'react-router-redux'; |
6 import handleTransitions from 'redux-history-transitions'; |
6 import handleTransitions from 'redux-history-transitions'; |
7 import createSagaMiddleware from 'redux-saga' |
7 import createSagaMiddleware from 'redux-saga' |
8 import Immutable from 'immutable'; |
8 import Immutable from 'immutable'; |
|
9 import APIClient from '../APIClient'; |
|
10 import config from '../config'; |
9 |
11 |
10 const token = localStorage.getItem('token'); |
12 const token = localStorage.getItem('token'); |
11 const currentUser = localStorage.getItem('currentUser'); |
13 const currentUser = localStorage.getItem('currentUser'); |
12 |
14 |
13 const defaultState = { |
15 const defaultState = { |
35 const store = createStore(rootReducer, initialState, compose( |
37 const store = createStore(rootReducer, initialState, compose( |
36 applyMiddleware(router, saga), |
38 applyMiddleware(router, saga), |
37 transitions |
39 transitions |
38 )); |
40 )); |
39 |
41 |
40 saga.run(rootSaga) |
42 const context = { |
|
43 client: new APIClient(config.apiRootUrl) |
|
44 } |
|
45 |
|
46 saga.run(rootSaga, context); |
41 |
47 |
42 store.dispatch(loadSessions()); |
48 store.dispatch(loadSessions()); |
43 |
49 |
44 return store; |
50 return store; |
45 }; |
51 }; |