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

@@ -13,6 +13,8 @@ import {
typeArrayDelete,
typeArrayMap,
YArrayRefID,
callTypeObservers,
transact,
Y, Transaction, ItemType, // eslint-disable-line
} from '../internals.js'
@@ -75,7 +77,7 @@ export class YArray extends AbstractType {
* @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified.
*/
_callObserver (transaction, parentSubs) {
this._callEventHandler(transaction, new YArrayEvent(this, transaction))
callTypeObservers(this, transaction, new YArrayEvent(this, transaction))
}
/**
@@ -141,7 +143,7 @@ export class YArray extends AbstractType {
*/
delete (index, length = 1) {
if (this._y !== null) {
this._y.transact(transaction => {
transact(this._y, transaction => {
typeArrayDelete(transaction, this, index, length)
})
} else {
@@ -168,7 +170,7 @@ export class YArray extends AbstractType {
*/
insert (index, content) {
if (this._y !== null) {
this._y.transact(transaction => {
transact(this._y, transaction => {
typeArrayInsertGenerics(transaction, this, index, content)
})
} else {