feat(Relays): added logic to manage relays #63
@ -16,3 +16,9 @@ export interface RestoreState {
|
||||
type: typeof ActionTypes.RESTORE_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 { RelaysState } from './relays/types'
|
||||
import relaysReducer from './relays/reducer'
|
||||
import * as ActionTypes from './actionTypes'
|
||||
|
||||
export interface State {
|
||||
auth: AuthState
|
||||
@ -14,9 +15,20 @@ export interface State {
|
||||
relays: RelaysState
|
||||
}
|
||||
|
||||
export default combineReducers({
|
||||
export const appReducer = combineReducers({
|
||||
auth: authReducer,
|
||||
metadata: metadataReducer,
|
||||
userRobotImage: userRobotImageReducer,
|
||||
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