Options
All
  • Public
  • Public/Protected
  • All
Menu

Holds a reference to a value. Multiple things can share the reference, or have their own. The shared value can be changed to a new value making all other references dirty so they know they need to be updated.

Type parameters

  • T

Hierarchy

  • Ref

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Ref(value: T, shared: boolean): Ref
  • Creates a new reference to the given value.

    Parameters

    • value: T

      The value the reference points to.

    • shared: boolean

      If the value is shared by multiple things.

    Returns Ref

Properties

dirty

dirty: boolean

If this reference is holding a dirty (out of date) value.

shared

shared: boolean

If the value is shared by multiple things.

value

value: T

The value the reference points to.

Methods

getReplace

  • getReplace(newValue: T): Ref<T>
  • Returns a reference to update to a new value making this shared reference dirty.

    If this reference is shared, this reference is marked dirty and a new reference is returned with the new value. If this reference is not shared, the value on this instance will be updated and the reference to this instance will be returned.

    Parameters

    • newValue: T

      The new value for the reference returned.

    Returns Ref<T>

getUpdate

  • getUpdate(newValue: T): Ref<T>
  • Returns a reference to update to the new value.

    If this reference is shared, a new reference instance will be returned. If this reference is not shared, the value on this instance will be updated and the reference to this instance will be returned.

    Parameters

    • newValue: T

      The new value for the reference returned.

    Returns Ref<T>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc