Yjs Docs
  • Introduction
  • Yjs in the Wild
  • License ❤️
  • 🚲Getting Started
    • A Collaborative Editor
    • Awareness & Presence
    • Offline Support
    • Shared Types
  • 🔥Ecosystem
    • Editor Bindings
      • ProseMirror
      • TipTap
      • Monaco
      • Quill
      • CodeMirror
      • Remirror
      • Milkdown
      • Slate
    • Connection Provider
      • y-websocket
      • y-webrtc
      • y-webxdc
      • y-dat
      • y-sweet
      • Liveblocks
      • SuperViz
    • Database Provider
      • y-indexeddb
      • y-leveldb
      • y-redis
    • Other
      • y-protocols
    • Ports to other languages
  • 🔧API
    • Y.Doc
    • Shared Types
      • Y.Map
      • Y.Array
      • Y.Text
      • Y.XmlFragment
      • Y.XmlElement
      • Y.XmlText
    • Y.UndoManager
    • Y.Event
    • Delta Format
    • Document Updates
    • Y.RelativePosition
    • Awareness
    • Subdocuments
    • Internals
    • FAQ
  • 🧪Tutorials
    • Meshing Providers
    • Persisting the Document to a Central Database
    • Indefinite Scaling with y-redis
    • Lessons Learned
    • Custom Provider
  • 🌎External Resources
    • Talks, Podcasts, and Blogs
    • About CRDTs
    • CRDT Benchmarks
    • Yjs Discussion Board
    • Yjs Chat
    • Kevin's Blog
    • Awesome People ⭐
Powered by GitBook
On this page

Was this helpful?

Edit on Git
  1. API

Y.Event

PreviousY.UndoManagerNextDelta Format

Last updated 4 years ago

Was this helpful?

Y.Event API

yevent.target: Y.AbstractType The shared type that this event was created on. This event describes the changes on target.

yevent.currentTarget: Y.AbstractType The current target of the event as the event traverses through the (deep)observer callbacks. It refers to the type on which the event handler (observe/observeDeep) has been attached. Similar to .

yevent.transaction: Y.Transaction The transaction in which this event was created on.

yevent.path: Array<String|number> Computes the path from the Y.Doc to the changed type. You can traverse to the changed type by calling ydoc.get(path[0]).get(path[1]).get(path[2]).get( ...

yevent.changes.delta: Delta Computes the changes in the array-delta format. See more in the section. The text delta is only available on Y.TextEvent (ytextEvent.delta)

yevent.changes.keys: Map<string, { action: 'add' | 'update' | 'delete', oldValue: any }> Computes changes on the attributes / key-value map of a shared type. In Y.Map it is used to represent changed keys. In Y.Xml it is used to describe changes on the XML-attributes.

🔧
Event.currentTarget
Delta Format