sdk-js

@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

Name Type
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

Name Type
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

Name Type
onfinally? () => any

Returns

Promise<P> & SubscribablePromise<T, P>

Defined in

src/utils/SubscribablePromise.ts:37


init

init(executor): void

Parameters

Name Type
executor (observer: SubscribableObserver<T, P>) => void | Promise<P>

Returns

void

Defined in

src/utils/SubscribablePromise.ts:41


next

next(onNext): SubscribablePromise<T, P>

Parameters

Name Type
onNext (next: T) => void

Returns

SubscribablePromise<T, P>

Defined in

src/utils/SubscribablePromise.ts:24


subscribe

subscribe(onNext): Object

Parameters

Name Type
onNext (next: T) => void

Returns

Object

Name Type
unsubscribe () => boolean

Defined in

src/utils/SubscribablePromise.ts:20


then

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

Parameters

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

Returns

Promise<any> & SubscribablePromise<T, P>

Defined in

src/utils/SubscribablePromise.ts:29