member_webapp/@overflow/noauth-probe/store/connecting/noauth-probe-connecting.reducer.ts

22 lines
559 B
TypeScript
Raw Normal View History

2018-05-31 07:38:44 +00:00
import { ActionType, Actions } from './noauth-probe-connecting.action';
import {
State,
initialState,
noAuthProbeConnectingAdapter,
} from './noauth-probe-connecting.state';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.OnConnect: {
return noAuthProbeConnectingAdapter.upsertOne(action.payload, state);
}
case ActionType.OnDisconnect: {
return noAuthProbeConnectingAdapter.upsertOne(action.payload, state);
}
default: {
return state;
}
}
}