Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Observable<T>

This class is another aid in buliding reactive compoennts, by invoking onUpdate listeners when the value property is set.

Type parameters

  • T

Hierarchy

  • Observable

Index

Constructors

  • arg

    _value This is the default value of the Observable.

    Type parameters

    • T

    Parameters

    • _value: T

    Returns Observable<T>

Properties

callbacks: ((value: T) => void)[] = []

Accessors

  • get value(): T
  • set value(value: T): void

Methods

  • onUpdate(cb: (value: T) => void): void
  • This registers a listener for when the the value property is set

    Parameters

    • cb: (value: T) => void
        • (value: T): void
        • Parameters

          • value: T

          Returns void

    Returns void

  • removeListener(cb: (value: T) => void): void
  • This removes a listener.

    Parameters

    • cb: (value: T) => void
        • (value: T): void
        • Parameters

          • value: T

          Returns void

    Returns void

  • setValueSync(value: T): void
  • This method sets the value and calls the listeners syncronously.

    Parameters

    • value: T

    Returns void

Generated using TypeDoc