20 lines
479 B
TypeScript
Raw Normal View History

2019-09-25 17:26:19 +09:00
import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { buddy2Data, buddy2Success } from './actions';
export const reducer = createReducer(
initialState,
on(buddy2Data, (state, action) => {
return {
...state,
buddyInfoList: [...state.buddyInfoList, ...action.data.buddyInfos]
};
}),
on(buddy2Success, (state, action) => {
return {
...state,
buddy2SyncDate: action.res.syncDate
};
})
);