2020-02-07 15:29:16 +09:00

28 lines
682 B
TypeScript

import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { selectedGnbMenuIndex, organizationTreeActivated } from './actions';
import * as AuthenticationStore from '@app/store/account/authentication';
export const reducer = createReducer(
initialState,
on(selectedGnbMenuIndex, (state, action) => {
return {
...state,
gnbMenuIndex: action.menuIndex
};
}),
on(organizationTreeActivated, (state, action) => {
return {
...state,
organizationTreeActivated: action.activate
};
}),
on(AuthenticationStore.logoutInitialize, (state, action) => {
return {
...initialState
};
})
);