23 lines
503 B
TypeScript
23 lines
503 B
TypeScript
import { Action } from 'redux';
|
|
|
|
import { PartnerInfo } from '@/types/partner';
|
|
|
|
import { SET_INVITE_CODE } from '../constants';
|
|
|
|
const INIT_STATE: Partial<PartnerInfo> = {};
|
|
|
|
const partnerInfo = (state: Partial<PartnerInfo> = INIT_STATE, action: Action): Partial<PartnerInfo> => {
|
|
const { type, value } = action as BL.Anything;
|
|
switch (type) {
|
|
case SET_INVITE_CODE: {
|
|
return {
|
|
inviteCode: value,
|
|
};
|
|
}
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default partnerInfo;
|