chore(Store): added USER_LOGOUT action

This commit is contained in:
Yury 2024-05-24 15:30:29 +03:00
parent 424e06a52b
commit f4ecbe5f39
2 changed files with 19 additions and 1 deletions

View File

@ -16,3 +16,9 @@ export interface RestoreState {
type: typeof ActionTypes.RESTORE_STATE type: typeof ActionTypes.RESTORE_STATE
payload: State payload: State
} }
export const userLogOutAction = () => {
return {
type: ActionTypes.USER_LOGOUT
}
}

View File

@ -6,6 +6,7 @@ import metadataReducer from './metadata/reducer'
import userRobotImageReducer from './userRobotImage/reducer' import userRobotImageReducer from './userRobotImage/reducer'
import { RelaysState } from './relays/types' import { RelaysState } from './relays/types'
import relaysReducer from './relays/reducer' import relaysReducer from './relays/reducer'
import * as ActionTypes from './actionTypes'
export interface State { export interface State {
auth: AuthState auth: AuthState
@ -14,9 +15,20 @@ export interface State {
relays: RelaysState relays: RelaysState
} }
export default combineReducers({ export const appReducer = combineReducers({
auth: authReducer, auth: authReducer,
metadata: metadataReducer, metadata: metadataReducer,
userRobotImage: userRobotImageReducer, userRobotImage: userRobotImageReducer,
relays: relaysReducer relays: relaysReducer
}) })
// FIXME: define types
export default (state: any, action: any) => {
switch (action.type) {
case ActionTypes.USER_LOGOUT:
return appReducer(undefined, action)
default:
return appReducer(state, action)
}
}