import { Store } from '@ngrx/store';
import { SignupStore } from '../../interfaces/store/signup.store';
import { Injectable } from '@angular/core';

import { signupActions } from './signup.actions';

@Injectable({
  providedIn: 'root',
})
export class SignupDispatchers {
  constructor(private store: Store<{ signup: SignupStore }>) {}

  setSignup(newState: SignupStore) {
    this.store.dispatch(signupActions.set_signup({ signup: newState }));
  }

  clearSignup() {
    this.store.dispatch(signupActions.clear_signup());
  }
}
