- Notifications
You must be signed in to change notification settings - Fork1
deeplay-io/abort-controller-x-rxjs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Abortable helpers for RxJS.
This is a companion package ofabort-controller-x.
yarn add abort-controller-x-rxjsfunctiondefer<RextendsObservableInput<any>|void>(observableFactory:(signal:AbortSignal)=>R,):Observable<ObservedValueOf<R>>;
Like originaldefer from RxJS,but aborts passed function when unsubscribed.
functionfirstValueFrom<T,D>(signal:AbortSignal,source:Observable<T>,config:FirstValueFromConfig<D>,):Promise<T|D>;functionfirstValueFrom<T>(signal:AbortSignal,source:Observable<T>,):Promise<T>;interfaceFirstValueFromConfig<T>{defaultValue:T;}
Like originalfirstValueFrom fromRxJS, but acceptsAbortSignal. When that signal is aborted, unsubscribes fromthe observable and throwsAbortError.
functionlastValueFrom<T,D>(signal:AbortSignal,source:Observable<T>,config:LastValueFromConfig<D>,):Promise<T|D>;functionlastValueFrom<T>(signal:AbortSignal,source:Observable<T>,):Promise<T>;interfaceLastValueFromConfig<T>{defaultValue:T;}
Like originallastValueFrom from RxJS,but acceptsAbortSignal. When that signal is aborted, unsubscribes from theobservable and throwsAbortError.
functionfromAsyncGenerator<T>(fn:(signal:AbortSignal)=>AsyncIterable<T>,):Observable<T>;
Turns abortable async generator to observable.
About
Abortable helpers for RxJS
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.