@liveblocks/react 0.18.0-beta4 → 0.18.0

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.
@@ -1 +1 @@
1
- ff5604e48f99b968e9dae639dfc5bace0e57087c
1
+ ab4dc80c03188cfbc87c124cad9c824347a785b0
package/index.d.ts CHANGED
@@ -166,13 +166,6 @@ declare type RoomContextBundle<TPresence extends JsonObject, TStorage extends Ls
166
166
  * const [root] = useStorageRoot();
167
167
  */
168
168
  useStorageRoot(): [root: LiveObject<TStorage> | null];
169
- /**
170
- * Returns your entire Liveblocks Storage as an immutable data structure.
171
- *
172
- * @example
173
- * const root = useStorage();
174
- */
175
- useStorage(): ToImmutable<TStorage> | null;
176
169
  /**
177
170
  * Extract arbitrary data from the Liveblocks Storage state, using an
178
171
  * arbitrary selector function.
@@ -192,7 +185,7 @@ declare type RoomContextBundle<TPresence extends JsonObject, TStorage extends Ls
192
185
  * return the result of a .map() or .filter() call from the selector. In
193
186
  * those cases, you'll probably want to use a `shallow` comparison check.
194
187
  */
195
- useStorage<T>(selector: (root: ToImmutable<TStorage>) => T, isEqual?: (prev: T, curr: T) => boolean): T | null;
188
+ useStorage<T>(selector: (root: ToImmutable<TStorage>) => T, isEqual?: (prev: T | null, curr: T | null) => boolean): T | null;
196
189
  /**
197
190
  * Gets the current user once it is connected to the room.
198
191
  *
@@ -490,13 +483,6 @@ declare type RoomContextBundle<TPresence extends JsonObject, TStorage extends Ls
490
483
  * const [root] = useStorageRoot();
491
484
  */
492
485
  useStorageRoot(): [root: LiveObject<TStorage> | null];
493
- /**
494
- * Returns your entire Liveblocks Storage as an immutable data structure.
495
- *
496
- * @example
497
- * const root = useStorage();
498
- */
499
- useStorage(): ToImmutable<TStorage>;
500
486
  /**
501
487
  * Extract arbitrary data from the Liveblocks Storage state, using an
502
488
  * arbitrary selector function.
package/index.js CHANGED
@@ -345,10 +345,9 @@ function createRoomContext(client) {
345
345
  return root.get(key);
346
346
  }
347
347
  }
348
- function useStorage(maybeSelector, isEqual) {
348
+ function useStorage(selector, isEqual) {
349
349
  const room = useRoom();
350
350
  const rootOrNull = useMutableStorageRoot();
351
- const selector = maybeSelector != null ? maybeSelector : identity;
352
351
  const wrappedSelector = React2.useCallback(
353
352
  (rootOrNull2) => rootOrNull2 !== null ? selector(rootOrNull2) : null,
354
353
  [selector]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react",
3
- "version": "0.18.0-beta4",
3
+ "version": "0.18.0",
4
4
  "description": "A set of React hooks and providers to use Liveblocks declaratively.",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
@@ -27,7 +27,7 @@
27
27
  "use-sync-external-store": "^1.2.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@liveblocks/client": "0.18.0-beta4",
30
+ "@liveblocks/client": "0.18.0",
31
31
  "react": "^16.14.0 || ^17 || ^18"
32
32
  },
33
33
  "repository": {