chore(Store): added USER_LOGOUT action
This commit is contained in:
parent
424e06a52b
commit
f4ecbe5f39
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user