Options
Menu

Class StringRemoveEvent

Emitted when one or more characters were removed from a RealTimeString. See RealTimeString.remove

In this example, note the properties that get printed out in the event subscription:

model.emitLocalEvents(true);

let rtStr = model.elementAt('foo');
rtStr.value() // "bar"

rtStr.events().subscribe(function(e) {
  console.log('event name:', e.name);
  console.log('event local?', e.local);
  console.log('removed at index', e.index);
  console.log('removed value:', e.value);
});

rtStr.remove(1, 2);
// event name: "remove"
// event local? true
// removed at index 1
// removed value: "ar"

Hierarchy

  • StringRemoveEvent

Implements

Index

Properties

element

The RealTimeString or HistoricalString which was modified

index

index: number

The index at which the character(s) were removed

local

local: boolean

name

name: string = StringRemoveEvent.NAME

The name of the event that was fired. This is commonly used to filter when using the ConvergenceEventEmitter.events stream.

Note that the name is only guaranteed to be unique within the class / subsystem that is firing it. Names might be reused across classes and subsystems.

sessionId

sessionId: string

The sessionId corresponding to the session that performed the modification

user

The user which performed the modification

value

value: string

The actual substring that was removed

NAME

NAME: "remove" = "remove"