diff --git a/CHANGELOG.md b/CHANGELOG.md index 010286d..b4aa40a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ +## [2.1.1](https://github.com/sketch7/ngx.command/compare/2.1.0...2.1.1) (2022-09-26) + +### Bug Fixes + +- **command:** execute throwing error due to `first` (empty sequence) + ## [2.1.0](https://github.com/sketch7/ngx.command/compare/2.0.0...2.1.0) (2022-07-12) ### Bug Fixes diff --git a/package.json b/package.json index cfd0cf0..f1c083f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ssv/ngx.command", - "version": "2.1.0", + "version": "2.1.1", "versionSuffix": "", "description": "Command pattern implementation for angular. Command used to encapsulate information which is needed to perform an action.", "keywords": [ diff --git a/src/command.ts b/src/command.ts index 2efb8c4..6045fd0 100644 --- a/src/command.ts +++ b/src/command.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { Observable, combineLatest, Subscription, Subject, BehaviorSubject, of, EMPTY } from "rxjs"; -import { tap, map, filter, switchMap, catchError, finalize, first } from "rxjs/operators"; +import { tap, map, filter, switchMap, catchError, finalize, take } from "rxjs/operators"; import { ICommand } from "./command.model"; /** @@ -136,7 +136,7 @@ export class Command implements ICommand { // console.log("[command::executionPipe$] finalize inner#1 - set idle"); this._isExecuting$.next(false); }), - first(), + take(1), catchError(error => { console.error("Unhandled execute error", error); return EMPTY;