Options
Menu

Class LocalElementReference

An ElementReference that was created locally. See RealTimeModel.elementReference

Hierarchy

Index

Properties

StaticEvents

Events: ModelReferenceEvents = ModelReference.Events

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

localReference.on(LocalModelReference.Events.SET, function listener(e) {
  // ...
})

Methods

addListener

clear

  • clear(): void
  • Clears any values on this reference. This is a way to explictly indicate that the reference currently has no value.

    Returns void

dispose

  • dispose(): void

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

isLocal

  • isLocal(): boolean

isSet

  • isSet(): boolean

isShared

  • isShared(): 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.

reference

removeAllListeners

removeListener

removeListeners

sessionId

  • sessionId(): string

set

share

  • share(): void
  • Publishes the reference, such that other users with access to the attached model can access this reference and its underlying value(s). If the reference is already shared, the call will simply be ignored.

    Returns void

source

type

unshare

  • unshare(): void
  • Unpublishes the reference, essentially making it private. If the reference is not currently shared, the call will simply be ignored.

    Returns void

user

value

values