Options
Menu

Class HistoricalObject

A read-only history-aware version of a RealTimeObject. See HistoricalElement and HistoricalModel for some common usages.

Hierarchy

Implements

Index

Properties

Events

Events: HistoricalObjectEvents = ObservableObjectEventConstants

Methods

addListener

elementAt

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.

forEach

  • Synchronously calls the provided callback function for each key-value pair in this object at the current version.

    Parameters

    Returns void

get

hasKey

  • hasKey(key: string): boolean
  • Returns true if the provided key existed on this object at the current version.

    Parameters

    • key: string

    Returns boolean

id

  • id(): string

isAttached

  • isAttached(): boolean

isDetached

  • isDetached(): boolean

keys

  • keys(): string[]
  • Returns an array of all the current version's keys

    Returns string[]

    an array with all the current version's keys

model

off

on

once

parent

path

relativePath

  • This returns the PathElement representing this element's location relevant to its parent. For example, given a model with contents

    {
      obj: {
        with: 1,
        stuff: ['a', 'string']
      }
    }
    
    let rtNumber = rtModel.elementAt(['obj', 'with']);
    rtNumber.value() // 1
    rtNumber.relativePath() // 'with'
    
    let rtString = rtModel.elementAt(['obj', 'stuff', 0]);
    rtString.value() // 'a'
    rtString.relativePath() // 0
    

    Returns PathElement

    a PathElement representing this node's location relative to its parent, or null if it has no parent.

removeAllListeners

removeListener

removeListeners

toJSON

  • toJSON(): any

type

  • type(): string

value

  • value(): {}