28 lines
682 B
TypeScript
Raw Normal View History

2020-01-21 13:32:10 +09:00
import { createReducer, on } from '@ngrx/store';
2019-11-21 10:29:19 +09:00
import { initialState } from './state';
2020-02-07 15:29:16 +09:00
import { selectedGnbMenuIndex, organizationTreeActivated } from './actions';
2019-11-21 10:29:19 +09:00
2020-01-21 13:32:10 +09:00
import * as AuthenticationStore from '@app/store/account/authentication';
export const reducer = createReducer(
initialState,
on(selectedGnbMenuIndex, (state, action) => {
return {
...state,
gnbMenuIndex: action.menuIndex
};
}),
2020-02-07 15:29:16 +09:00
on(organizationTreeActivated, (state, action) => {
return {
...state,
organizationTreeActivated: action.activate
};
}),
2020-01-21 13:32:10 +09:00
on(AuthenticationStore.logoutInitialize, (state, action) => {
return {
...initialState
};
})
);