YEvent(target, transaction)

YEvent describes the changes on a YType.

new YEvent(target, transaction)

Parameters:
Name Type Description
target AbstractType.<any>

The changed type.

transaction Transaction

Members

currentTarget :AbstractType.<any>

The current target on which the observe callback is called.

path

Computes the path from y to the changed type.

The following property holds:

Example
let type = y
  event.path.forEach(dir => {
    type = type.get(dir)
  })
  type === event.target // => true

target :AbstractType.<any>

The type on which this event was created on.

transaction :Transaction

The transaction that triggered this event.

Methods

adds(struct) → {boolean}

Check if a struct is added by this event.

Parameters:
Name Type Description
struct AbstractStruct
Returns:
boolean

deletes(struct) → {boolean}

Check if a struct is deleted by this event.

Parameters:
Name Type Description
struct AbstractStruct
Returns:
boolean