2019-09-25 17:26:19 +09:00
|
|
|
import { createReducer, on } from '@ngrx/store';
|
|
|
|
import { initialState } from './state';
|
2019-10-02 15:49:25 +09:00
|
|
|
import { buddy2Success, group2Success, roomSuccess } from './actions';
|
2019-09-25 17:26:19 +09:00
|
|
|
|
|
|
|
export const reducer = createReducer(
|
|
|
|
initialState,
|
|
|
|
on(buddy2Success, (state, action) => {
|
|
|
|
return {
|
|
|
|
...state,
|
2019-10-02 14:34:17 +09:00
|
|
|
buddyInfoList: action.buddyList,
|
|
|
|
buddy2SyncDate: action.syncDate
|
2019-09-25 18:08:50 +09:00
|
|
|
};
|
|
|
|
}),
|
2019-10-02 14:34:17 +09:00
|
|
|
|
2019-09-25 18:08:50 +09:00
|
|
|
on(group2Success, (state, action) => {
|
|
|
|
return {
|
|
|
|
...state,
|
2019-10-02 14:34:17 +09:00
|
|
|
groupList: action.groupList,
|
|
|
|
group2SyncDate: action.syncDate
|
2019-09-25 18:08:50 +09:00
|
|
|
};
|
2019-10-02 15:49:25 +09:00
|
|
|
}),
|
|
|
|
|
|
|
|
on(roomSuccess, (state, action) => {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
roomList: action.roomList,
|
|
|
|
roomUserInfoMap: action.roomUserInfoMap,
|
|
|
|
roomSyncDate: action.syncDate
|
|
|
|
};
|
2019-09-25 17:26:19 +09:00
|
|
|
})
|
|
|
|
);
|