Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Status

Hierarchy

Callable

  • Reads the cached value from the property. The local cached value may differ from the corresponding value on the server.

    Returns OnlineStatus

  • Changes the value of the property. If the property is linked to a value on the server, this sends a requets to the server; however to track the progress of the operation, use .set(...).

    Parameters

    Returns any

Index

Properties

Methods

Properties

changed

changed: Event<function>

This event is fired whenever the property's value gets changed. The parameters are (new value, reason, old value).

get

get: Command

Fetches the actual value from the server.

reason

reason: any

The reason why the property has this value. It can be changed by the .set(...) function.

set

set: Command

Requests to change the value and returns a promise that gets resolved after the value is changed.

Methods

fork

map

  • Creates a property which value is derived from this property's value. The following is true at all times:

    p.map(fn)() == fn(p());

    The created property is read only and changes after the origin property.

    Type parameters

    • U

    Parameters

    Returns Property<U>

once

  • once(value: OnlineStatus | function, fn: function): object
  • Same as adding a listener to the .changed event that removes itself once the needed event appears:

    p.changed(function listener(newValue, reason, oldValue) { if (newValue == 3) { p.changed.off(listener); ... } });

    Parameters

    Returns object

    • dispose: function
        • (): void
        • Returns void

subscribe

  • subscribe(): object
  • Tells the property to keep its value up to date. This may result in creating a subscription on the server. If the value of the property is needed only once, it's preferrable to use .get().

    Returns object

    • dispose: function
        • (): void
        • Returns void

when

  • when(value: OnlineStatus | function, fn: function): object
  • Same as adding a listener to the .changed event with an if condition inside:

    p.changed((newValue, reason, oldValue) => { if (newValue == 3) { ... } });

    Parameters

    Returns object

    • dispose: function
        • (): void
        • Returns void

Generated using TypeDoc