ProtoTwin API
    Preparing search index...

    Class Notifier<T>

    Simple subscribable object.

    It's generally good practice not to expose a property of this type, since the notify function is public. Insead, it is recommended to make the notifier private and expose a getter with the type Subscribable.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Constructor.

      Type Parameters

      • T

      Returns Notifier<T>

    Accessors

    • get subscribed(): boolean

      Whether there are any subscribers.

      Returns boolean

    Methods

    • Notifies all subscribers.

      Parameters

      • current: T

        The value to be passed to all subscribers.

      Returns void

    • Unsubscribes.

      Parameters

      Returns boolean

      True if the subscription was canceled, false otherwise.