21 lines
408 B
TypeScript
Raw Normal View History

2020-03-27 17:39:01 +09:00
import { createReducer, on } from '@ngrx/store';
import { initialState } from './state';
import { loginSuccess, logoutSuccess } from './actions';
export const reducer = createReducer(
initialState,
on(loginSuccess, (state, action) => {
return {
...state,
loginRes: action.loginRes
};
}),
on(logoutSuccess, (state, action) => {
return {
...initialState
};
})
);