import { handleActions , Action } from "redux-actions" ; import { showPopove , token , user , loginType , toastMsg , targetPage } from "../state/state" ; import types from "../types/typs" ; import { IUser , IToastMsg } from 'src/components/Type/Type' ; import { ShowPopoveType } from 'src/components/Type/ReduxType' ; const tokenReducer = handleActions < string > ( { [ types . TOKEN ] : ( state , action ) => action . payload } , token ) ; const userReducer = handleActions < IUser > ( { [ types . USER_MSG ] : ( state , action ) => ( { ... action . payload } ) } , user ) ; const popoveReducer = handleActions < ShowPopoveType > ( { [ types . POPOVE_STATE ] : ( state , action ) => { return ( { ... action . payload } ) ; } } , showPopove ) ; const loginTypeReducer = handleActions < string > ( { [ types . LOGIN_TYPE ] : ( state , action ) => action . payload } , loginType ) ; const toastReducer = handleActions < IToastMsg > ( { [ types . TOAST_STAUS ] : ( state , action ) => { return ( { ... action . payload } ) ; } } , toastMsg ) ; const targetPageReducer = handleActions < string > ( { [ types . TARGET_PAGE ] : ( state , action ) => action . payload } , targetPage ) ; export default { loginTypeReducer , popoveReducer , toastReducer , tokenReducer , userReducer , targetPageReducer } ;