Skip to content

Instantly share code, notes, and snippets.

@anteburazer
Created May 12, 2017 08:00
Show Gist options
  • Save anteburazer/d4a6c3f7eee32e78af16afda9e57634c to your computer and use it in GitHub Desktop.
Save anteburazer/d4a6c3f7eee32e78af16afda9e57634c to your computer and use it in GitHub Desktop.
@Injectable()
export class AuthSandbox extends Sandbox {
public loginLoading$ = this.appState$.select(store.getLoginLoading);
public loginLoaded$ = this.appState$.select(store.getLoginLoaded);
public passwordRecoveryLoading$ = this.appState$.select(store.getPasswordRecoveryLoading);
public passwordRecoveryLoaded$ = this.appState$.select(store.getPasswordRecoveryLoaded);
constructor(protected appState$: Store<store.State>) {
super(appState$);
}
/**
* Dispatches login action
*
* @param form
*/
public login(form: any): void {
this.appState$.dispatch(new authActions.DoLoginAction(new Login(form)));
}
/**
* Dispatches reset password action
*
* @param form
*/
public resetPassword(form: any): void {
this.appState$.dispatch(new authActions.DoPasswordRecoveryAction(new ResetPassword(form)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment