import { ActionCreatorsMapObject , ActionCreator } from "redux" ; import { ForkEffect } from "redux-saga/effects" ; import { SceneReducer } from "../types" ; import ActionTypes from "../ActionTypes" ; import getCurtainInitState from "./getCurtainInitState" ; import { AnyAction } from "redux" ; import { CurtainState } from "./types" ; function curtainReducer ( state , action , bindedReducerKey ) { switch ( action . type ) { case ActionTypes . ARENA_CURTAIN_SET_STATE : return Object . assign ( { } , state , action . state ) ; case ActionTypes . ARENA_CURTAIN_REPLACE_STATE : return Object . assign ( { } , action . state ) ; default : return state ; } } export default function createCurtainReducer ( bindedReducerKey ) { return function ( state = getCurtainInitState ( ) , action ) { if ( bindedReducerKey === action . _reducerKey ) { state = curtainReducer ( state , action , bindedReducerKey ) ; } return state ; } ; }