20 lines
479 B
TypeScript
20 lines
479 B
TypeScript
|
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
|
||
|
};
|
||
|
})
|
||
|
);
|