Options
All
  • Public
  • Public/Protected
  • All
Menu

Reference class to use whenever a reference to an object is needed - for example, with JSX ref attributes and services.

Type parameters

  • T = any

Hierarchy

Implements

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new Ref<T>(listener?: RefFunc<T>, initialReference?: T): Ref<T>

Accessors

r

  • get r(): undefined | T
  • set r(v: undefined | T): void
  • Get accessor for the reference value

    Returns undefined | T

  • Set accessor for the reference value

    Parameters

    • v: undefined | T

    Returns void

Methods

attach

clear

  • clear(): void
  • Removes all listeners to the event.

    Returns void

detach

fire

  • fire(...args: [newRef: T]): void
  • Method that raises the event and calls all the listeners (if any). It has the signature of the template function so only proper-types parameters can be passed to it.

    Parameters

    • Rest ...args: [newRef: T]

    Returns void

has

  • has(): boolean
  • Determines whether this event slot has any listeners.

    Returns boolean