UNPKG

565 BJavaScriptView Raw
1import { createStore, compose, applyMiddleware } from "redux";
2import gameActionMiddleware from "./game-action-middleware";
3import { gameMiddleware } from "./game-middleware";
4import invariant from "redux-immutable-state-invariant";
5import reducer from "./reducer";
6import thunk from "redux-thunk";
7
8export default function() {
9 const composeEnhancers =
10 window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
11 return createStore(
12 reducer,
13 composeEnhancers(
14 applyMiddleware(invariant(), gameActionMiddleware, thunk, gameMiddleware)
15 )
16 );
17}