member_webapp/@overflow/discovery/store/regist/regist.reducer.ts
crusader d59d9379f9 ing
2018-05-24 15:44:13 +09:00

46 lines
831 B
TypeScript

import {
Actions,
ActionType,
} from './regist.action';
import {
State,
initialState,
} from './regist.state';
import { DiscoveryStartInfo } from '@overflow/commons-typescript/model/discovery';
export function reducer(state = initialState, action: Actions): State {
switch (action.type) {
case ActionType.SaveAllTarget: {
return {
...state,
error: null,
isPending: true,
};
}
case ActionType.SaveAllTargetSuccess: {
return {
...state,
error: null,
isPending: false,
isSuccess: action.payload,
};
}
case ActionType.SaveAllTargetFailure: {
return {
...state,
error: action.payload,
isPending: false,
isSuccess: null,
};
}
default: {
return state;
}
}
}