Compare commits

...

2 Commits

Author SHA1 Message Date
Kevin Jahns
2fbba13246 13.6.4 2023-06-15 13:11:40 +02:00
Kevin Jahns
885a740470 heavily improve performance when there are many events 2023-06-15 13:09:30 +02:00
3 changed files with 8 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "yjs",
"version": "13.6.3",
"version": "13.6.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yjs",
"version": "13.6.3",
"version": "13.6.4",
"license": "MIT",
"dependencies": {
"lib0": "^0.2.74"

View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "13.6.3",
"version": "13.6.4",
"description": "Shared Editing Library",
"main": "./dist/yjs.cjs",
"module": "./dist/yjs.mjs",

View File

@@ -44,6 +44,10 @@ export class YEvent {
* @type {null | Array<{ insert?: string | Array<any> | object | AbstractType<any>, retain?: number, delete?: number, attributes?: Object<string, any> }>}
*/
this._delta = null
/**
* @type {Array<string|number>|null}
*/
this._path = null
}
/**
@@ -60,8 +64,7 @@ export class YEvent {
* type === event.target // => true
*/
get path () {
// @ts-ignore _item is defined because target is integrated
return getPathTo(this.currentTarget, this.target)
return this._path || (this._path = getPathTo(this.currentTarget, this.target))
}
/**