@hocuspocus/provider
Advanced tools
Comparing version 1.0.0-alpha.22 to 1.0.0-alpha.23
@@ -1888,7 +1888,7 @@ import * as Y from 'yjs'; | ||
} | ||
catch (err) { | ||
// If we aborted the connection attempt then don't throw an error | ||
catch (error) { | ||
// If we aborted the connection attempt then don’t throw an error | ||
// ref: https://github.com/lifeomic/attempt/blob/master/src/index.ts#L136 | ||
if (err.code !== 'ATTEMPT_ABORTED') { | ||
throw err; | ||
if (error && error.code !== 'ATTEMPT_ABORTED') { | ||
throw error; | ||
} | ||
@@ -2053,3 +2053,2 @@ } | ||
this.startSync(); | ||
this.resolveConnectionAttempt(); | ||
} | ||
@@ -2076,2 +2075,3 @@ startSync() { | ||
onMessage(event) { | ||
this.resolveConnectionAttempt(); | ||
this.lastMessageReceived = getUnixTime(); | ||
@@ -2078,0 +2078,0 @@ const message = new IncomingMessage(event.data); |
@@ -48,2 +48,7 @@ /// <reference types="node" /> | ||
} | ||
export declare type Hook = 'onAuthenticate' | 'onChange' | 'onConnect' | 'onConfigure' | | ||
/** | ||
* @deprecated onCreateDocument is deprecated, use onLoadDocument instead | ||
*/ | ||
'onCreateDocument' | 'onLoadDocument' | 'onDestroy' | 'onDisconnect' | 'onListen' | 'onRequest' | 'onUpgrade'; | ||
export interface Configuration extends Extension { | ||
@@ -50,0 +55,0 @@ /** |
{ | ||
"name": "@hocuspocus/provider", | ||
"version": "1.0.0-alpha.22", | ||
"version": "1.0.0-alpha.23", | ||
"description": "hocuspocus provider", | ||
@@ -36,3 +36,3 @@ "homepage": "https://hocuspocus.dev", | ||
}, | ||
"gitHead": "f9f5acf828d4a1f5ae4df8188000b5c3873e18cf", | ||
"gitHead": "f85955a7cca23b23044b0579e96fc8d17c107a4c", | ||
"publishConfig": { | ||
@@ -39,0 +39,0 @@ "access": "public" |
@@ -278,7 +278,7 @@ import * as Y from 'yjs' | ||
}) | ||
} catch (err: any) { | ||
// If we aborted the connection attempt then don't throw an error | ||
} catch (error: any) { | ||
// If we aborted the connection attempt then don’t throw an error | ||
// ref: https://github.com/lifeomic/attempt/blob/master/src/index.ts#L136 | ||
if (err.code !== 'ATTEMPT_ABORTED') { | ||
throw err | ||
if (error && error.code !== 'ATTEMPT_ABORTED') { | ||
throw error | ||
} | ||
@@ -479,4 +479,2 @@ } | ||
this.startSync() | ||
this.resolveConnectionAttempt() | ||
} | ||
@@ -509,2 +507,4 @@ | ||
onMessage(event: MessageEvent) { | ||
this.resolveConnectionAttempt() | ||
this.lastMessageReceived = time.getUnixTime() | ||
@@ -511,0 +511,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
534351
6114