sdk-js

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

Class: SubscribableObserver<T, P>

Type parameters

Name
T
P

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SubscribableObserver<T, P>(): SubscribableObserver<T, P>

Type parameters

Name
T
P

Returns

SubscribableObserver<T, P>

Properties

completed

completed: boolean = false

Defined in

src/utils/SubscribableObserver.ts:2


subscriptions

Private subscriptions: Set<{ onComplete?: (complete: P) => void ; onError?: (error: any) => void ; onNext?: (next: T) => void }>

Defined in

src/utils/SubscribableObserver.ts:4

Methods

complete

complete(resolve?): void

Parameters

Name Type
resolve? P

Returns

void

Defined in

src/utils/SubscribableObserver.ts:30


emit

emit(type, value): void

Parameters

Name Type
type "onNext" | "onComplete" | "onError"
value any

Returns

void

Defined in

src/utils/SubscribableObserver.ts:40


error

error(error?): void

Parameters

Name Type
error? any

Returns

void

Defined in

src/utils/SubscribableObserver.ts:35


next

next(next?): void

Parameters

Name Type
next? T

Returns

void

Defined in

src/utils/SubscribableObserver.ts:26


subscribe

subscribe(onNext?, onComplete?, onError?): Object

Parameters

Name Type
onNext? (next: T) => void
onComplete? (complete: P) => void
onError? (error: any) => void

Returns

Object

Name Type
unsubscribe () => boolean

Defined in

src/utils/SubscribableObserver.ts:10


unsubscribe

unsubscribe(): void

Returns

void

Defined in

src/utils/SubscribableObserver.ts:47