ydb client
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
4
src/Y.js
4
src/Y.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user