next-ucap-messenger/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts

24 lines
570 B
TypeScript
Raw Normal View History

2019-10-08 02:19:47 +00:00
import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { infoSuccess } from './actions';
2019-10-11 04:11:48 +00:00
import * as AuthenticationStore from '@app/store/account/authentication';
2019-10-08 02:19:47 +00:00
export const reducer = createReducer(
initialState,
on(infoSuccess, (state, action) => {
return {
...state,
roomInfo: action.roomInfo,
userInfoList: action.userInfoList,
userInfoShortList: action.userInfoShortList
};
2019-10-11 04:11:48 +00:00
}),
on(AuthenticationStore.logout, (state, action) => {
return {
...initialState
};
2019-10-08 02:19:47 +00:00
})
);