How to use the @ngxs/store.ofActionErrored function in @ngxs/store

To help you get started, we’ve selected a few @ngxs/store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xmlking / ngx-starter-kit / apps / default / src / app / core / state / eventbus.ts View on Github external
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'));
  }
}
github xmlking / ngx-starter-kit / libs / auth / src / lib / auth.handler.ts View on Github external
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'));
  }
}
github openradiation / openradiation-mobile / src / app / pages / tabs / history / history.page.ts View on Github external
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)),
github ngxs / ngxs-examples / projects / wiki-search / src / app / wiki-article / content-component / content.component.ts View on Github external
private subscribeToActionErrored(): void {
    this.actions$
      .pipe(
        ofActionErrored(LoadContent),
        takeUntil(this.unsubscriber$)
      )
      .subscribe(() => {
        this.errorString = 'Something wrong with Wiki API';
      });
  }
}