@@ -2,6 +2,7 @@ import { combineReducers, legacy_createStore } from 'redux';
22import { getRandomAvatarOption } from '@/utils' ;
33import { WrapperShape } from '@/enums' ;
44import { SCREEN } from '@/constants' ;
5+ import { ActionTypes } from '@/types' ;
56import { REDO , SET_AVATAR_OPTION , SET_SIDER_STATUS , UNDO } from './mutation-type' ;
67
78
@@ -16,7 +17,7 @@ const initialState = {
1617} ;
1718
1819// Reducer
19- const historyReducer = ( state = initialState . history , action : any ) => {
20+ const historyReducer = ( state = initialState . history , action : ActionTypes ) => {
2021 switch ( action . type ) {
2122 case SET_AVATAR_OPTION :
2223 return {
@@ -51,8 +52,7 @@ const historyReducer = (state = initialState.history, action: any) => {
5152 }
5253} ;
5354
54- const isSiderCollapsedReducer = ( state = initialState . isCollapsed , action : any ) => {
55- // TOOD any类型
55+ const isSiderBarCollapsedReducer = ( state = initialState . isCollapsed , action : ActionTypes ) => {
5656 switch ( action . type ) {
5757 case SET_SIDER_STATUS :
5858 return action . payload ;
@@ -64,7 +64,7 @@ const isSiderCollapsedReducer = (state = initialState.isCollapsed, action: any)
6464// Combine Reducers
6565const rootReducer = combineReducers ( {
6666 history : historyReducer ,
67- isCollapsed : isSiderCollapsedReducer ,
67+ isCollapsed : isSiderBarCollapsedReducer ,
6868} ) ;
6969const store = legacy_createStore ( rootReducer ) ;
7070// Store
0 commit comments