Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Ref<T>

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

Type parameters

  • T

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

constructor

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

    • Optional listener: RefFunc<T>
    • Optional initialReferene: T

    Returns Ref

Accessors

r

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

    Returns T

  • Set accessor for the reference value

    Parameters

    • v: T

    Returns void

Methods

addListener

  • addListener(listener: RefFunc<T>): void
  • Adds a callback that will be invoked when the value of the reference changes.

    Parameters

    Returns void

removeListener

  • removeListener(listener: RefFunc<T>): void
  • Removes a callback that was added with addListener.

    Parameters

    Returns void

Generated using TypeDoc