Created
May 12, 2017 08:00
-
-
Save anteburazer/d4a6c3f7eee32e78af16afda9e57634c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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