Options
Menu

Module Real Time Data

When considering implementing real-time collaboration, most developers think (and only think!) about the various algorithms for synchronizing data. This indeed is a core consideration for collaborative editing systems, and many tomes have been written about it. Convergence's main goal is to insulate developers from the difficulties of implementing Operational Transformation. It does this by supporting a strict set of data: JSON.

See our developer guide for additional information.

To get started with Real Time Data, get an instance of the ModelService from the ConvergenceDomain.

Index

Interfaces

Type aliases

Object literals

Classes

Type aliases

ModelDataCallback

ModelDataCallback: () => ModelData

A callback function that will result in some model data that will become the model's initial contents.

Type declaration

ModelDataInitializer

ModelDataInitializer: ModelData | ModelDataCallback

Either some data or a callback returning data can be provided.

OfflineModelDownloadStatusChangeTrigger

OfflineModelDownloadStatusChangeTrigger: "download" | "subscription_changed"

Indicates what triggered the change to the download status. A value of "download" indicates that the change was triggered by a model being downloaded. A value of "subscription_change" indicates the event was triggered by a change to the subscription.

experimental

Path

Path: PathElement[]

A Path is essentially a set of instructions for retrieving a particular piece of data (subtree) within a model's contents (JSON tree). e.g.

for a model with contents

{
  "firstName": "James",
  "kidsAges": [4, 7, 9]
}

one could query:

realTimeModel.elementAt(['firstName']) // RealTimeString, value() => "James"
realTimeModel.elementAt(['kidsAges', 1]) // RealTimeNumber, value() => 7

See the developer guide for more examples of using paths to get parts of a model's contents.

PathElement

PathElement: string | number

A PathElement is a particular desired node within a RealTimeModel's contents, which can be thought of as a JSON tree.

These have no meaning outside of a Path.

ReferenceType

ReferenceType: "index" | "range" | "element" | "property"

A unified type representing any type of reference.

Object literals

ModelServiceEventConstants

ModelServiceEventConstants: object

OFFLINE_MODELS_DOWNLOAD_COMPLETED

OFFLINE_MODELS_DOWNLOAD_COMPLETED: "offline_models_download_completed" = "offline_models_download_completed"

OFFLINE_MODELS_DOWNLOAD_PENDING

OFFLINE_MODELS_DOWNLOAD_PENDING: "offline_models_download_pending" = "offline_models_download_pending"

OFFLINE_MODELS_DOWNLOAD_PROGRESS

OFFLINE_MODELS_DOWNLOAD_PROGRESS: "offline_models_download_progress" = "offline_models_download_progress"

OFFLINE_MODELS_SYNC_ABORTED

OFFLINE_MODELS_SYNC_ABORTED: "offline_models_sync_aborted" = "offline_models_sync_aborted"

OFFLINE_MODELS_SYNC_COMPLETED

OFFLINE_MODELS_SYNC_COMPLETED: "offline_models_sync_completed" = "offline_models_sync_completed"

OFFLINE_MODELS_SYNC_PROGRESS

OFFLINE_MODELS_SYNC_PROGRESS: "offline_models_sync_progress" = "offline_models_sync_progress"

OFFLINE_MODELS_SYNC_STARTED

OFFLINE_MODELS_SYNC_STARTED: "offline_models_sync_started" = "offline_models_sync_started"

OFFLINE_MODEL_DELETED

OFFLINE_MODEL_DELETED: "offline_model_deleted" = "offline_model_deleted"

OFFLINE_MODEL_PERMISSIONS_REVOKED

OFFLINE_MODEL_PERMISSIONS_REVOKED: "offline_model_permissions_revoked" = "offline_model_permissions_revoked"

OFFLINE_MODEL_STATUS_CHANGED

OFFLINE_MODEL_STATUS_CHANGED: "offline_model_status_changed" = "offline_model_status_changed"

OFFLINE_MODEL_SYNC_COMPLETED

OFFLINE_MODEL_SYNC_COMPLETED: "offline_model_sync_completed" = "offline_model_sync_completed"

OFFLINE_MODEL_SYNC_ERROR

OFFLINE_MODEL_SYNC_ERROR: "offline_model_sync_error" = "offline_model_sync_error"

OFFLINE_MODEL_SYNC_STARTED

OFFLINE_MODEL_SYNC_STARTED: "offline_model_sync_started" = "offline_model_sync_started"

OFFLINE_MODEL_UPDATED

OFFLINE_MODEL_UPDATED: "offline_model_updated" = "offline_model_updated"

ObservableArrayEventConstants

ObservableArrayEventConstants: object

INSERT

INSERT: string = "insert"

REMOVE

REMOVE: string = "remove"

REORDER

REORDER: string = "reorder"

SET

SET: string = "set"

ObservableElementEventConstants

ObservableElementEventConstants: object

DETACHED

DETACHED: string = "detached"

MODEL_CHANGED

MODEL_CHANGED: string = "model_changed"

REFERENCE

REFERENCE: string = "reference"

VALUE

VALUE: string = "value"

ObservableModelEventConstants

ObservableModelEventConstants: object

CLOSED

CLOSED: string = "closed"

DELETED

DELETED: string = "deleted"

VERSION_CHANGED

VERSION_CHANGED: string = "version_changed"

ObservableNumberEventConstants

ObservableNumberEventConstants: object

DELTA

DELTA: string = "delta"

ObservableObjectEventConstants

ObservableObjectEventConstants: object

REMOVE

REMOVE: string = "remove"

SET

SET: string = "set"

ObservableStringEventConstants

ObservableStringEventConstants: object

INSERT

INSERT: string = "insert"

REMOVE

REMOVE: string = "remove"

SPLICE

SPLICE: string = "splice"