From d59e30b239eea63fc1184263002518eeb4fa4469 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 7 Nov 2017 19:18:41 -0800 Subject: [PATCH] implement generic YEvent with path property --- src/Type/YArray.js | 5 +++-- src/Type/YMap.js | 5 +++-- src/Type/y-xml/YXmlEvent.js | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Type/YArray.js b/src/Type/YArray.js index 85a9bb88..845b758e 100644 --- a/src/Type/YArray.js +++ b/src/Type/YArray.js @@ -1,10 +1,11 @@ import Type from '../Struct/Type.js' import ItemJSON from '../Struct/ItemJSON.js' import { logID } from '../MessageHandler/messageToString.js' +import YEvent from '../Util/YEvent.js' -class YArrayEvent { +class YArrayEvent extends YEvent { constructor (yarray, remote) { - this.target = yarray + super(yarray) this.remote = remote } } diff --git a/src/Type/YMap.js b/src/Type/YMap.js index 03cd780f..4fe73e2e 100644 --- a/src/Type/YMap.js +++ b/src/Type/YMap.js @@ -2,10 +2,11 @@ import Type from '../Struct/Type.js' import Item from '../Struct/Item.js' import ItemJSON from '../Struct/ItemJSON.js' import { logID } from '../MessageHandler/messageToString.js' +import YEvent from '../Util/YEvent.js' -class YMapEvent { +class YMapEvent extends YEvent { constructor (ymap, subs, remote) { - this.target = ymap + super(ymap) this.keysChanged = subs this.remote = remote } diff --git a/src/Type/y-xml/YXmlEvent.js b/src/Type/y-xml/YXmlEvent.js index 9435f718..b63f300d 100644 --- a/src/Type/y-xml/YXmlEvent.js +++ b/src/Type/y-xml/YXmlEvent.js @@ -1,7 +1,8 @@ +import YEvent from '../../Util/YEvent.js' -export default class YXmlEvent { +export default class YXmlEvent extends YEvent { constructor (target, subs, remote) { - this.target = target + super(target) this.childListChanged = false this.attributesChanged = new Set() this.remote = remote