import { createReducer, on } from '@ngrx/store';
import { initialState } from './signup.store';
import { signupActions } from './signup.actions';
import { SignupStore } from '../../interfaces/store/signup.store';

export const signupReducers = createReducer<SignupStore>(
  initialState,

  on(
    signupActions.set_signup,
    (state, action): SignupStore => ({ ...state, ...action.signup }),
  ),
  on(signupActions.clear_signup, () => ({}) as SignupStore),
);
