feat(Relays): added logic to manage relays #63

Closed
y wants to merge 8 commits from relays-management into main
2 changed files with 19 additions and 1 deletions
Showing only changes of commit f4ecbe5f39 - Show all commits

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)
}
}