Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Abortable helpers for RxJS

License

NotificationsYou must be signed in to change notification settings

deeplay-io/abort-controller-x-rxjs

Repository files navigation

Abortable helpers for RxJS.

This is a companion package ofabort-controller-x.

Installation

yarn add abort-controller-x-rxjs

API

defer

functiondefer<RextendsObservableInput<any>|void>(observableFactory:(signal:AbortSignal)=>R,):Observable<ObservedValueOf<R>>;

Like originaldefer from RxJS,but aborts passed function when unsubscribed.

firstValueFrom

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.

lastValueFrom

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.

fromAsyncGenerator

functionfromAsyncGenerator<T>(fn:(signal:AbortSignal)=>AsyncIterable<T>,):Observable<T>;

Turns abortable async generator to observable.

About

Abortable helpers for RxJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp