Skip to content

Commit 9e45f5e

Browse files
committed
type: fix any type
1 parent f2af6b5 commit 9e45f5e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/store/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { combineReducers, legacy_createStore } from 'redux';
22
import { getRandomAvatarOption } from '@/utils';
33
import { WrapperShape } from '@/enums';
44
import { SCREEN } from '@/constants';
5+
import { ActionTypes } from '@/types';
56
import { 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
6565
const rootReducer = combineReducers({
6666
history: historyReducer,
67-
isCollapsed: isSiderCollapsedReducer,
67+
isCollapsed: isSiderBarCollapsedReducer,
6868
});
6969
const store = legacy_createStore(rootReducer);
7070
// Store

0 commit comments

Comments
 (0)