Skip to main content

SubscribableValueEvent

class SubscribableValueEventT extends SubscribableTEventHandlerT

Provides safe access to the public interface of ValueDispatcher.

External classes can use it to subscribe to an event without being able to dispatch it.

Type Parameters

  • T

    The type of the value passed to subscribers.

Constructors

constructor

Type Parameters

Parameters

Inherited from Subscribable.constructor

Accessors

current

public get current(): T

Get the most recent value of this dispatcher.

Methods

subscribe

public override subscribehandler: EventHandlerTdispatchImmediately: boolean = true: () => void

Subscribe to the event.

Subscribing will immediately invoke the handler with the most recent value.

Parameters

Overwrites Subscribable.subscribe

unsubscribe

public unsubscribehandler: EventHandlerT: void

Unsubscribe from the event.

Parameters

Inherited from Subscribable.unsubscribe