@liveblocks/core 0.19.9 → 0.19.10
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/dist/index.js +10 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113,7 +113,7 @@ if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
|
|
|
113
113
|
var onMessageFromPanel = eventSource.observable;
|
|
114
114
|
|
|
115
115
|
// src/devtools/index.ts
|
|
116
|
-
var VERSION = true ? "0.19.
|
|
116
|
+
var VERSION = true ? "0.19.10" : "dev";
|
|
117
117
|
var _devtoolsSetupHasRun = false;
|
|
118
118
|
function setupDevTools(getAllRooms) {
|
|
119
119
|
if (process.env.NODE_ENV === "production" || typeof window === "undefined") {
|
|
@@ -4118,7 +4118,7 @@ function prepareCreateWebSocket(liveblocksServer, WebSocketPolyfill) {
|
|
|
4118
4118
|
const ws = WebSocketPolyfill || WebSocket;
|
|
4119
4119
|
return (token) => {
|
|
4120
4120
|
return new ws(
|
|
4121
|
-
`${liveblocksServer}/?token=${token}&version=${true ? "0.19.
|
|
4121
|
+
`${liveblocksServer}/?token=${token}&version=${true ? "0.19.10" : "dev"}`
|
|
4122
4122
|
);
|
|
4123
4123
|
};
|
|
4124
4124
|
}
|
|
@@ -4202,6 +4202,9 @@ var AuthenticationError = class extends Error {
|
|
|
4202
4202
|
};
|
|
4203
4203
|
|
|
4204
4204
|
// src/client.ts
|
|
4205
|
+
var MIN_THROTTLE = 16;
|
|
4206
|
+
var MAX_THROTTLE = 1e3;
|
|
4207
|
+
var DEFAULT_THROTTLE = 100;
|
|
4205
4208
|
function createClient(options) {
|
|
4206
4209
|
const clientOptions = options;
|
|
4207
4210
|
const throttleDelay = getThrottleDelayFromOptions(options);
|
|
@@ -4286,10 +4289,12 @@ function createClient(options) {
|
|
|
4286
4289
|
}
|
|
4287
4290
|
function getThrottleDelayFromOptions(options) {
|
|
4288
4291
|
if (options.throttle === void 0) {
|
|
4289
|
-
return
|
|
4292
|
+
return DEFAULT_THROTTLE;
|
|
4290
4293
|
}
|
|
4291
|
-
if (typeof options.throttle !== "number" || options.throttle <
|
|
4292
|
-
throw new Error(
|
|
4294
|
+
if (typeof options.throttle !== "number" || options.throttle < MIN_THROTTLE || options.throttle > MAX_THROTTLE) {
|
|
4295
|
+
throw new Error(
|
|
4296
|
+
`throttle should be a number between ${MIN_THROTTLE} and ${MAX_THROTTLE}.`
|
|
4297
|
+
);
|
|
4293
4298
|
}
|
|
4294
4299
|
return options.throttle;
|
|
4295
4300
|
}
|