fixed some example issues
This commit is contained in:
parent
e32aef4c9f
commit
51e20fb9c7
@ -140,6 +140,10 @@ gulp.task('dev:browser', ['build:test'], function () {
|
|||||||
.pipe(jasmineBrowser.server({port: options.testport}))
|
.pipe(jasmineBrowser.server({port: options.testport}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
gulp.task('dev:deploy', ['build:deploy'], function () {
|
||||||
|
gulp.watch('src/**/*.js', ['build:deploy'])
|
||||||
|
})
|
||||||
|
|
||||||
gulp.task('dev', ['build:test'], function () {
|
gulp.task('dev', ['build:test'], function () {
|
||||||
gulp.start('dev:browser')
|
gulp.start('dev:browser')
|
||||||
gulp.start('dev:node')
|
gulp.start('dev:node')
|
||||||
|
@ -83,6 +83,9 @@ class WebRTC extends Y.AbstractConnector {
|
|||||||
broadcast (message) {
|
broadcast (message) {
|
||||||
this.swr.sendDirectlyToAll('simplewebrtc', 'yjs', message)
|
this.swr.sendDirectlyToAll('simplewebrtc', 'yjs', message)
|
||||||
}
|
}
|
||||||
|
isDisconnected () {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Y.WebRTC = WebRTC
|
Y.WebRTC = WebRTC
|
||||||
|
@ -305,9 +305,9 @@ class AbstractOperationStore {
|
|||||||
}
|
}
|
||||||
os.gc2 = os.gc1
|
os.gc2 = os.gc1
|
||||||
os.gc1 = []
|
os.gc1 = []
|
||||||
if (os.gcTimeout > 0) {
|
}
|
||||||
os.gcInterval = setTimeout(garbageCollect, os.gcTimeout)
|
if (os.gcTimeout > 0) {
|
||||||
}
|
os.gcInterval = setTimeout(garbageCollect, os.gcTimeout)
|
||||||
}
|
}
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
@ -490,7 +490,7 @@ class AbstractOperationStore {
|
|||||||
* tryExecute (op) {
|
* tryExecute (op) {
|
||||||
if (op.struct === 'Delete') {
|
if (op.struct === 'Delete') {
|
||||||
yield* Y.Struct.Delete.execute.call(this, op)
|
yield* Y.Struct.Delete.execute.call(this, op)
|
||||||
} else if ((yield* this.getOperation(op.id)) == null) {
|
} else if ((yield* this.getOperation(op.id)) == null && !this.store.ds.isGarbageCollected(op.id)) {
|
||||||
yield* Y.Struct[op.struct].execute.call(this, op)
|
yield* Y.Struct[op.struct].execute.call(this, op)
|
||||||
var next = yield* this.addOperation(op)
|
var next = yield* this.addOperation(op)
|
||||||
yield* this.store.operationAdded(this, op, next)
|
yield* this.store.operationAdded(this, op, next)
|
||||||
|
@ -10,6 +10,10 @@ class DeleteStore extends Y.utils.RBTree {
|
|||||||
var n = this.findNodeWithUpperBound(id)
|
var n = this.findNodeWithUpperBound(id)
|
||||||
return n !== null && n.val.id[0] === id[0] && id[1] < n.val.id[1] + n.val.len
|
return n !== null && n.val.id[0] === id[0] && id[1] < n.val.id[1] + n.val.len
|
||||||
}
|
}
|
||||||
|
isGarbageCollected (id) {
|
||||||
|
var n = this.findNodeWithUpperBound(id)
|
||||||
|
return n !== null && n.val.id[0] === id[0] && id[1] < n.val.id[1] + n.val.len && n.val.gc
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Mark an operation as deleted&gc'd
|
Mark an operation as deleted&gc'd
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user