ydb client

This commit is contained in:
Kevin
2018-10-08 16:09:50 +02:00
parent 9d5bf50676
commit b98ebddb69
22 changed files with 1484 additions and 11 deletions

View File

@@ -5,7 +5,8 @@ import { sendSyncStep1, readSyncStep1 } from './MessageHandler/syncStep1.js'
import { readSyncStep2 } from './MessageHandler/syncStep2.js'
import { integrateRemoteStructs } from './MessageHandler/integrateRemoteStructs.js'
import debug from 'debug'
// TODO: reintroduce or remove
// import debug from 'debug'
// TODO: rename Connector

View File

@@ -22,7 +22,6 @@ import QuillBinding from './Bindings/QuillBinding/QuillBinding.js'
import DomBinding from './Bindings/DomBinding/DomBinding.js'
import { toBinary, fromBinary } from './MessageHandler/binaryEncode.js'
import debug from 'debug'
import domToType from './Bindings/DomBinding/domToType.js'
import { domsToTypes, switchAssociation } from './Bindings/DomBinding/util.js'
@@ -56,7 +55,4 @@ Y.utils = {
fromBinary
}
Y.debug = debug
debug.formatters.Y = messageToString
debug.formatters.y = messageToRoomname
export default Y

View File

@@ -36,12 +36,12 @@ export default class Y extends NamedEventHandler {
* @type {String}
*/
this.room = room
if (opts != null) {
if (opts != null && opts.connector != null) {
opts.connector.room = room
}
this._contentReady = false
this._opts = opts
if (typeof opts.userID !== 'number') {
if (opts == null || typeof opts.userID !== 'number') {
this.userID = generateRandomUint32()
} else {
this.userID = opts.userID