Home Reference Source
import Binding from 'yjs/src/Bindings/Binding.js'
public class | source

Binding

Abstract class for bindings.

A binding handles data binding from a Yjs type to a data object. For example, you can bind a Quill editor instance to a YText instance with the QuillBinding class.

It is expected that a concrete implementation accepts two parameters (type and binding target).

Example:

  const quill = new Quill(document.createElement('div'))
  const type = y.define('quill', Y.Text)
  const binding = new Y.QuillBinding(quill, type)

Constructor Summary

Public Constructor
public

constructor(type: YType, target: any)

Member Summary

Public Members
public

target: *

The target that type is bound to.

public

type: YType

The Yjs type that is bound to target

Method Summary

Public Methods
public

Remove all data observers (both from the type and the target).

Public Constructors

public constructor(type: YType, target: any) source

Params:

NameTypeAttributeDescription
type YType

Yjs type.

target any

Binding Target.

Public Members

public target: * source

The target that type is bound to.

public type: YType source

The Yjs type that is bound to target

Public Methods

public destroy() source

Remove all data observers (both from the type and the target).