implement some of the commented todos

This commit is contained in:
Kevin Jahns
2019-04-09 04:01:37 +02:00
parent 1b06f59d1c
commit 52ec698635
24 changed files with 233 additions and 243 deletions

View File

@@ -11,6 +11,8 @@ import {
typeMapHas,
createMapIterator,
YMapRefID,
callTypeObservers,
transact,
Y, Transaction, ItemType, // eslint-disable-line
} from '../internals.js'
@@ -75,7 +77,7 @@ export class YMap extends AbstractType {
* @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified.
*/
_callObserver (transaction, parentSubs) {
this._callEventHandler(transaction, new YMapEvent(this, transaction, parentSubs))
callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs))
}
/**
@@ -125,7 +127,7 @@ export class YMap extends AbstractType {
*/
delete (key) {
if (this._y !== null) {
this._y.transact(transaction => {
transact(this._y, transaction => {
typeMapDelete(transaction, this, key)
})
} else {
@@ -142,7 +144,7 @@ export class YMap extends AbstractType {
*/
set (key, value) {
if (this._y !== null) {
this._y.transact(transaction => {
transact(this._y, transaction => {
typeMapSet(transaction, this, key, value)
})
} else {