Skip to main content

SubscribablePromise

@nevermined-io/sdk - v3.0.44 / SubscribablePromise

Class: SubscribablePromise\<T, P>

Type parameters

Name
T
P

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SubscribablePromise\<T, P>(executor): SubscribablePromise\<T, P>

Type parameters

Name
T
P

Parameters

NameType
executor(observer: SubscribableObserver\<T, P>) => void | Promise\<P>

Returns

SubscribablePromise\<T, P>

Defined in

src/utils/SubscribablePromise.ts:15

Properties

observer

Private observer: SubscribableObserver\<T, P>

Defined in

src/utils/SubscribablePromise.ts:4


promise

Private promise: Promise\<P> & SubscribablePromise\<T, P>

Defined in

src/utils/SubscribablePromise.ts:6

Methods

catch

catch(onrejected?): Promise\<any> & SubscribablePromise\<T, P>

Parameters

NameType
onrejected?(error: any) => any

Returns

Promise\<any> & SubscribablePromise\<T, P>

Defined in

src/utils/SubscribablePromise.ts:33


finally

finally(onfinally?): Promise\<P> & SubscribablePromise\<T, P>

Parameters

NameType
onfinally?() => any

Returns

Promise\<P> & SubscribablePromise\<T, P>

Defined in

src/utils/SubscribablePromise.ts:37


init

init(executor): void

Parameters

NameType
executor(observer: SubscribableObserver\<T, P>) => void | Promise\<P>

Returns

void

Defined in

src/utils/SubscribablePromise.ts:41


next

next(onNext): SubscribablePromise\<T, P>

Parameters

NameType
onNext(next: T) => void

Returns

SubscribablePromise\<T, P>

Defined in

src/utils/SubscribablePromise.ts:24


subscribe

subscribe(onNext): Object

Parameters

NameType
onNext(next: T) => void

Returns

Object

NameType
unsubscribe() => boolean

Defined in

src/utils/SubscribablePromise.ts:20


then

then(onfulfilled?, onrejected?): Promise\<any> & SubscribablePromise\<T, P>

Parameters

NameType
onfulfilled?(value: P) => any
onrejected?(error: any) => any

Returns

Promise\<any> & SubscribablePromise\<T, P>

Defined in

src/utils/SubscribablePromise.ts:29