mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Merge branch 'graphql' of https://github.com/coralproject/talk into graphql
This commit is contained in:
@@ -3,15 +3,22 @@ import thunk from 'redux-thunk';
|
||||
import mainReducer from './reducers';
|
||||
import {client} from './client';
|
||||
|
||||
const middlewares = [
|
||||
applyMiddleware(client.middleware()),
|
||||
applyMiddleware(thunk)
|
||||
];
|
||||
|
||||
if (window.devToolsExtension) {
|
||||
|
||||
// we can't have the last argument of compose() be undefined
|
||||
middlewares.push(window.devToolsExtension());
|
||||
}
|
||||
|
||||
export default createStore(
|
||||
combineReducers({
|
||||
...mainReducer,
|
||||
apollo: client.reducer()
|
||||
}),
|
||||
{},
|
||||
compose(
|
||||
applyMiddleware(client.middleware()),
|
||||
applyMiddleware(thunk),
|
||||
window.devToolsExtension && window.devToolsExtension()
|
||||
)
|
||||
compose(...middlewares)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user