Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(private actions$: Actions) {
this.actions$.pipe(ofActionDispatched(Login)).subscribe(action => console.log('Login.......Action Dispatched'));
this.actions$.pipe(ofActionSuccessful(Login)).subscribe(action => console.log('Login........Action Successful'));
this.actions$.pipe(ofActionErrored(Login)).subscribe(action => console.log('Login........Action Errored'));
}
}
constructor(private actions$: Actions) {
this.actions$.pipe(ofActionSuccessful(Login)).subscribe(action => console.log('Login........Action Successful'));
this.actions$.pipe(ofActionErrored(Login)).subscribe(action => console.log('Login........Action Errored'));
}
}
pageEnter() {
super.pageEnter();
this.subscriptions.push(
this.actions$.pipe(ofActionErrored(PublishMeasure)).subscribe(({ measure }: PublishMeasure) => {
this.measureBeingSentMap[measure.id] = false;
this.toastController
.create({
message: this.translateService.instant('HISTORY.SEND_ERROR'),
showCloseButton: true,
duration: 3000,
closeButtonText: this.translateService.instant('GENERAL.OK')
})
.then(toast => toast.present());
}),
this.actions$.pipe(ofActionDispatched(PublishMeasure)).subscribe(({ measure }: PublishMeasure) => {
this.measureBeingSentMap[measure.id] = true;
}),
this.actions$
.pipe(ofActionSuccessful(PublishMeasure))
.subscribe(({ measure }: PublishMeasure) => (this.measureBeingSentMap[measure.id] = false)),
private subscribeToActionErrored(): void {
this.actions$
.pipe(
ofActionErrored(LoadContent),
takeUntil(this.unsubscriber$)
)
.subscribe(() => {
this.errorString = 'Something wrong with Wiki API';
});
}
}