@graffy/client 0.16.10-alpha.1 → 0.16.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +2 -3
- package/index.mjs +2 -3
- package/package.json +3 -3
package/index.cjs
CHANGED
|
@@ -197,7 +197,7 @@ function Socket(url, { onUnhandled = void 0, onStatusChange = void 0 } = {}) {
|
|
|
197
197
|
maybeConnect();
|
|
198
198
|
}
|
|
199
199
|
function maybeConnect() {
|
|
200
|
-
const connDelay = lastAttempt + Math.min(MAX_DELAY, MIN_DELAY *
|
|
200
|
+
const connDelay = lastAttempt + Math.min(MAX_DELAY, MIN_DELAY * DELAY_GROWTH ** attempts) - Date.now();
|
|
201
201
|
log("Will reconnect in", connDelay, "ms");
|
|
202
202
|
if (connDelay <= 0) {
|
|
203
203
|
connect();
|
|
@@ -317,8 +317,7 @@ const WSRE = /^wss?:\/\//;
|
|
|
317
317
|
function GraffyClient(baseUrl, options) {
|
|
318
318
|
if (WSRE.test(baseUrl)) {
|
|
319
319
|
return wsClient(baseUrl, options);
|
|
320
|
-
} else {
|
|
321
|
-
return httpClient(baseUrl, options);
|
|
322
320
|
}
|
|
321
|
+
return httpClient(baseUrl, options);
|
|
323
322
|
}
|
|
324
323
|
module.exports = GraffyClient;
|
package/index.mjs
CHANGED
|
@@ -196,7 +196,7 @@ function Socket(url, { onUnhandled = void 0, onStatusChange = void 0 } = {}) {
|
|
|
196
196
|
maybeConnect();
|
|
197
197
|
}
|
|
198
198
|
function maybeConnect() {
|
|
199
|
-
const connDelay = lastAttempt + Math.min(MAX_DELAY, MIN_DELAY *
|
|
199
|
+
const connDelay = lastAttempt + Math.min(MAX_DELAY, MIN_DELAY * DELAY_GROWTH ** attempts) - Date.now();
|
|
200
200
|
log("Will reconnect in", connDelay, "ms");
|
|
201
201
|
if (connDelay <= 0) {
|
|
202
202
|
connect();
|
|
@@ -316,9 +316,8 @@ const WSRE = /^wss?:\/\//;
|
|
|
316
316
|
function GraffyClient(baseUrl, options) {
|
|
317
317
|
if (WSRE.test(baseUrl)) {
|
|
318
318
|
return wsClient(baseUrl, options);
|
|
319
|
-
} else {
|
|
320
|
-
return httpClient(baseUrl, options);
|
|
321
319
|
}
|
|
320
|
+
return httpClient(baseUrl, options);
|
|
322
321
|
}
|
|
323
322
|
export {
|
|
324
323
|
GraffyClient as default
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graffy/client",
|
|
3
3
|
"description": "Graffy client library for the browser, usin the `fetch()` or `WebSocket` APIs. This module is intended to be used with a Node.js server running Graffy Server.",
|
|
4
4
|
"author": "aravind (https://github.com/aravindet)",
|
|
5
|
-
"version": "0.16.
|
|
5
|
+
"version": "0.16.11",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./index.mjs",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@graffy/common": "0.16.
|
|
20
|
-
"@graffy/stream": "0.16.
|
|
19
|
+
"@graffy/common": "0.16.11",
|
|
20
|
+
"@graffy/stream": "0.16.11",
|
|
21
21
|
"debug": "^4.3.3"
|
|
22
22
|
}
|
|
23
23
|
}
|