import { applyMiddleware , combineReducers , createStore , Store } from "redux" ; import createSagaMiddleware from "redux-saga" ; import { roundInfoReducer } from "./roundInfo" ; import { RoundInfoState } from "@creature-chess/models" ; import { GameSagaContext } from "./sagas" ; export type GameState = { roundInfo : RoundInfoState ; } ; export const createGameStore = ( context ) => { const sagaMiddleware = createSagaMiddleware ( { context } ) ; const store = createStore ( combineReducers < GameState > ( { roundInfo : roundInfoReducer } ) , applyMiddleware ( sagaMiddleware ) ) ; return { store , sagaMiddleware } ; } ;