@liveblocks/core 0.19.9-beta4 → 0.19.10-beta0

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -5
  2. 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.9-beta4" : "dev";
116
+ var VERSION = true ? "0.19.10-beta0" : "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.9-beta4" : "dev"}`
4121
+ `${liveblocksServer}/?token=${token}&version=${true ? "0.19.10-beta0" : "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 100;
4292
+ return DEFAULT_THROTTLE;
4290
4293
  }
4291
- if (typeof options.throttle !== "number" || options.throttle < 80 || options.throttle > 1e3) {
4292
- throw new Error("throttle should be a number between 80 and 1000.");
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/core",
3
- "version": "0.19.9-beta4",
3
+ "version": "0.19.10-beta0",
4
4
  "description": "Shared code and foundational internals for Liveblocks",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",