Skip to content

Instantly share code, notes, and snippets.

@NikolayGalkin
Created April 3, 2017 15:25
Show Gist options
  • Save NikolayGalkin/ac08675af984bd9122c164c752e8024c to your computer and use it in GitHub Desktop.
Save NikolayGalkin/ac08675af984bd9122c164c752e8024c to your computer and use it in GitHub Desktop.
store.js
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