eventEmitter.InjectableNopeEventEmitter - ZeMA-gGmbH/NoPE-JS GitHub Wiki

Class: InjectableNopeEventEmitter<T, S, G>

eventEmitter.InjectableNopeEventEmitter

RsJX based Observable.

Contains additional Functionalities like:

  • property with the current value
  • function to publish values. (wrapper for next)
  • enables performing a subscription with synced call or a immediate call.

Type parameters

Name Type
T T
S T
G T

Hierarchy

Constructors

constructor

new InjectableNopeEventEmitter<T, S, G>(_options?)

Type parameters

Name Type
T T
S T
G T

Parameters

Name Type
_options TSubjectOptions

Inherited from

NopeEventEmitter.constructor

Properties

_subscriptions

_subscriptions: Set<() => void>

A Set containing the Subscriptions

Inherited from

NopeEventEmitter._subscriptions


disablePublishing

disablePublishing: boolean = false

Flag to Disable Publishing

Inherited from

NopeEventEmitter.disablePublishing


id

Readonly id: string

An id of the Observable. This might be usefull for debugging.

Inherited from

NopeEventEmitter.id


options

options: any

options.

Inherited from

NopeEventEmitter.options


setter

setter: (value: S, options?: Partial<IEventAdditionalData>) => { data: T ; valid: boolean } = null

Type declaration

(value, options?): Object

Function to specify a Setter

Parameters
Name Type
value S
options? Partial<IEventAdditionalData>
Returns

Object

Name Type
data T
valid boolean

Inherited from

NopeEventEmitter.setter

Accessors

getter

get getter(): (value: T) => G

Returns

fn

(value): G

Parameters
Name Type
value T
Returns

G

Inherited from

NopeEventEmitter.getter

set getter(_getter): void

Parameters

Name Type
_getter (value: T) => G

Returns

void

Inherited from

NopeEventEmitter.getter


hasSubscriptions

get hasSubscriptions(): boolean

Flag, showing if there exists any subscription this particular observer.

Returns

boolean

Inherited from

NopeEventEmitter.hasSubscriptions


observerLength

get observerLength(): number

Returns the amout of interessed Subscribers / Observers.

Returns

number

Inherited from

NopeEventEmitter.observerLength

Methods

dispose

dispose(): void

Function, used to dispose the observable. Every item will be unsubscribed.

Returns

void

Inherited from

NopeEventEmitter.dispose


emit

emit(value, options?): boolean

Function to update the Content

Parameters

Name Type Description
value S The content
options Partial<IEventAdditionalData> -

Returns

boolean

Inherited from

NopeEventEmitter.emit


enhancedSubscription

enhancedSubscription<K>(next, options?): Subscription

Create an enhanced Subscription of the Observable. Use the Pipes, to Define what should be subscribed.

Type parameters

Name
K

Parameters

Name Type Description
next (data: K) => void The Next Function, used to transmit changes
options Object The Options, used to determine the Enhancements.
options.pipe? IPipe<T | G, K> -
options.scope? Object -

Returns

Subscription

Inherited from

NopeEventEmitter.enhancedSubscription


once

once(func, options?): INopeObserver

Creates a Subscription for the value of the Observable. After one Update the Value will be deleted

Parameters

Name Type Description
func IEventCallback<G, IEventAdditionalData> Function which is called when new Datas are pushed
options? INopeSubscriptionOptions Additional Options

Returns

INopeObserver

Inherited from

NopeEventEmitter.once


subscribe

subscribe(observer, options?): INopeObserver

A Function to subscribe to updates of the Observable.

Parameters

Name Type Description
observer INopePartialObserver<G, IEventAdditionalData> | IEventCallback<G, IEventAdditionalData> The Observer. Could be a Function or a Partial Observer.
options INopeSubscriptionOptions Additional Options.

Returns

INopeObserver

Inherited from

NopeEventEmitter.subscribe


waitFor

waitFor(testCallback?, options?): Promise<G>

Async Function to Wait for an Update

Parameters

Name Type Description
testCallback IWaitForCallback<G, IEventAdditionalData> -
options INopeWaitForObservableChangeOptions Additional Options for the Wait Function.

Returns

Promise<G>

Inherited from

NopeEventEmitter.waitFor


waitForUpdate

waitForUpdate(options?): Promise<G>

Async Function to Wait for an Update

Parameters

Name Type Description
options? INopeSubscriptionOptions Additional Options for the Wait Function.

Returns

Promise<G>

Inherited from

NopeEventEmitter.waitForUpdate

⚠️ **GitHub.com Fallback** ⚠️