feat: Add 'connecting' event
As described in the [comment here](https://github.com/yjs/y-websocket/issues/7#issuecomment-623114183), a "connecting" event is useful for monkey-patching the authentication process in lieu of a more official API. Seems like this is a no-brainer addition.
This commit is contained in:
parent
5a36d77d48
commit
72c9978ceb
@ -84,6 +84,11 @@ const setupWS = provider => {
|
||||
provider.wsconnecting = true
|
||||
provider.wsconnected = false
|
||||
provider.synced = false
|
||||
|
||||
provider.emit('status', [{
|
||||
status: 'connecting'
|
||||
}])
|
||||
|
||||
websocket.onmessage = event => {
|
||||
provider.wsLastMessageReceived = time.getUnixTime()
|
||||
const encoder = readMessage(provider, new Uint8Array(event.data), true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user