Options
Menu

Class IndexReference

Represents one or more indices in a RealTimeString that must be adjusted while the data is changing. See the developer guide for some examples.

Hierarchy

Index

Methods

addListener

events

  • Provides the events emitted by this object as an Observable stream.

    example
    
    eventEmitter.events()
      .filter(e => e.name === "myevent")
      .subscribe(e => console.log(e));
    

    Returns Observable<IConvergenceEvent>

    An Observable stream of all events emitted by this object.

isDisposed

  • isDisposed(): boolean
  • Returns true if this reference has already been disposed (cleaned up).

    Returns boolean

isLocal

  • isLocal(): boolean
  • Returns true if this reference was created locally.

    Returns boolean

isSet

  • isSet(): boolean
  • Returns true if a value is currenly set on the reference.

    Returns boolean

key

  • key(): string
  • Returns the unique key corresponding to this reference.

    Returns string

off

on

once

  • Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.

    Parameters

    Returns ConvergenceEventEmitter<IConvergenceEvent>

    This object, in support of a fluent API.

removeAllListeners

removeListener

removeListeners

sessionId

  • sessionId(): string
  • Returns the session ID of the user session that created this reference.

    Returns string

source

type

user

value

  • value(): number
  • Returns the first value of the underlying reference.

    Returns number

values

  • values(): number[]
  • Returns all values of the underlying reference.

    Returns number[]

Object literals

Events

Events: object

A mapping of the events this instance could emit to each event's unique name. Use this to refer an event name:

reference.on(ModelReference.Events.SET, function listener(e) {
  // ...
})

CLEARED

CLEARED: string = ReferenceClearedEvent.NAME

DISPOSED

DISPOSED: string = ReferenceDisposedEvent.NAME

SET

SET: string = ReferenceSetEvent.NAME

Types

Types: object

All the types of references available on the various RealTimeElements.

ELEMENT

ELEMENT: "element" = "element"

INDEX

INDEX: "index" = "index"

PROPERTY

PROPERTY: "property" = "property"

RANGE

RANGE: "range" = "range"