How to use the ngrx-forms.ClearAsyncErrorAction function in ngrx-forms

To help you get started, we’ve selected a few ngrx-forms 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 MrWolfZ / ngrx-forms / example-app / src / app / async-validation / async-validation.effects.ts View on Github external
flatMap((resp: any) => {
              if (resp.totalItems > 0) {
                return [
                  new SetSearchResultAction(
                    resp.items.map((i: any) => i.volumeInfo.title),
                  ),
                  new ClearAsyncErrorAction(
                    fs.controls.searchTerm.id,
                    'exists',
                  ),
                ] as Action[];
              }

              return [
                new SetSearchResultAction([]),
                new SetAsyncErrorAction(
                  fs.controls.searchTerm.id,
                  'exists',
                  fs.value.searchTerm,
                ),
              ];
            }),
            catchError(_ => [