Options
Menu

Class HistoricalArray

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

Hierarchy

Implements

Index

Properties

Events

Events: HistoricalArrayEvents = ObservableArrayEventConstants

Methods

addListener

elementAt

events

forEach

  • Synchronously calls the provided callback function for each item in this array at the current version.

    Also see RealTimeArray.forEach.

    Parameters

    Returns void

get

id

  • id(): string

isAttached

  • isAttached(): boolean

isDetached

  • isDetached(): boolean

length

  • length(): number

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(): any[]