cleanup docs

This commit is contained in:
Kevin Jahns
2018-03-23 04:35:52 +01:00
parent 026675b438
commit 6dd43cde17
25 changed files with 218 additions and 82 deletions

View File

@@ -2,7 +2,7 @@
import { createMutualExclude } from '../Util/mutualExclude.js'
/**
* Abstract class for bindings
* 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.
@@ -18,16 +18,27 @@ import { createMutualExclude } from '../Util/mutualExclude.js'
*/
export default class Binding {
/**
* @param {YType} type Yjs type
* @param {any} target Binding Target
* @param {YType} type Yjs type.
* @param {any} target Binding Target.
*/
constructor (type, target) {
/**
* The Yjs type that is bound to `target`
* @type {YType}
*/
this.type = type
/**
* The target that `type` is bound to.
* @type {*}
*/
this.target = target
/**
* @private
*/
this._mutualExclude = createMutualExclude()
}
/**
* Remove all data observers (both from the type and th target).
* Remove all data observers (both from the type and the target).
*/
destroy () {
this.type = null