member_webapp/@overflow/noauth-probe/store/connecting/noauth-probe-connecting.reducer.ts
crusader e8ad7b6716 ing
2018-05-31 16:38:44 +09:00

22 lines
559 B
TypeScript

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