Created
April 3, 2017 15:25
-
-
Save NikolayGalkin/ac08675af984bd9122c164c752e8024c to your computer and use it in GitHub Desktop.
store.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from 'redux'; | |
import { browserHistory } from 'react-router'; | |
import { syncHistoryWithStore } from 'react-router-redux'; | |
import createSagaMiddleware from 'redux-saga'; | |
import mySaga from './sagas/sagas'; | |
import rootReducer from './reducers/index'; | |
import superagent from 'superagent'; | |
import feathers from 'feathers-client'; | |
import rest from 'feathers-rest/client'; | |
const defaultStore = {}; | |
const sagaMiddleware = createSagaMiddleware(); | |
const store = createStore(rootReducer, defaultStore, applyMiddleware(sagaMiddleware)); | |
const host = 'http://localhost:3030'; | |
export const app = feathers() | |
.configure(rest(host).superagent(superagent)) | |
.configure(feathers.hooks()) | |
.configure(feathers.authentication({ store: window.localStorage })); | |
sagaMiddleware.run(mySaga, app); | |
export const history = syncHistoryWithStore(browserHistory, store); | |
export default store; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment