big documentation update - all public functions and classes are documented now

This commit is contained in:
Kevin Jahns
2018-03-05 03:03:40 +01:00
parent dc22a79ac4
commit a9b610479d
33 changed files with 2426 additions and 168 deletions

View File

@@ -1,9 +1,27 @@
/**
* YEvent describes the changes on a YType.
*/
export default class YEvent {
/**
* @param {YType} target The changed type.
*/
constructor (target) {
this.target = target
this.currentTarget = target
}
/**
* Computes the path from `y` to the changed type.
*
* The following property holds:
* @example
* let type = y
* event.path.forEach(function (dir) {
* type = type.get(dir)
* })
* type === event.target // => true
*/
get path () {
const path = []
let type = this.target