@liveblocks/zustand 1.1.0-rc1 → 1.1.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.
- package/dist/index.d.ts +21 -3
- package/dist/index.js +2 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { JsonObject, LsonObject, BaseUserMeta, Json, Room, User, Client } from '@liveblocks/client';
|
|
1
|
+
import { JsonObject, LsonObject, BaseUserMeta, Json, Room, User, Status, Client } from '@liveblocks/client';
|
|
2
|
+
import { LegacyConnectionStatus } from '@liveblocks/core';
|
|
2
3
|
import { StoreMutatorIdentifier, StateCreator } from 'zustand';
|
|
3
4
|
|
|
4
5
|
declare type LiveblocksContext<TPresence extends JsonObject, TStorage extends LsonObject, TUserMeta extends BaseUserMeta, TRoomEvent extends Json> = {
|
|
@@ -25,9 +26,26 @@ declare type LiveblocksContext<TPresence extends JsonObject, TStorage extends Ls
|
|
|
25
26
|
*/
|
|
26
27
|
readonly isStorageLoading: boolean;
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Legacy connection status of the room.
|
|
30
|
+
*
|
|
31
|
+
* @deprecated This API will be removed in a future version of Liveblocks.
|
|
32
|
+
* Prefer using the newer `.status` property.
|
|
33
|
+
*
|
|
34
|
+
* We recommend making the following changes if you use these APIs:
|
|
35
|
+
*
|
|
36
|
+
* OLD STATUSES NEW STATUSES
|
|
37
|
+
* closed --> initial
|
|
38
|
+
* authenticating --> connecting
|
|
39
|
+
* connecting --> connecting
|
|
40
|
+
* open --> connected
|
|
41
|
+
* unavailable --> reconnecting
|
|
42
|
+
* failed --> disconnected
|
|
29
43
|
*/
|
|
30
|
-
readonly connection:
|
|
44
|
+
readonly connection: LegacyConnectionStatus;
|
|
45
|
+
/**
|
|
46
|
+
* Connection status of the room.
|
|
47
|
+
*/
|
|
48
|
+
readonly status: Status;
|
|
31
49
|
};
|
|
32
50
|
/**
|
|
33
51
|
* @deprecated Renamed to WithLiveblocks<...>
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,8 @@ var middlewareImpl = (config, options) => {
|
|
|
71
71
|
unsubscribeCallbacks.push(
|
|
72
72
|
room.events.connection.subscribe(() => {
|
|
73
73
|
updateLiveblocksContext(set, {
|
|
74
|
-
connection: room.getConnectionState()
|
|
74
|
+
connection: room.getConnectionState(),
|
|
75
|
+
status: room.getStatus()
|
|
75
76
|
});
|
|
76
77
|
})
|
|
77
78
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/zustand",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A middleware to integrate Liveblocks into Zustand stores. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"test:watch": "jest --silent --verbose --color=always --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@liveblocks/client": "1.1.0
|
|
23
|
-
"@liveblocks/core": "1.1.0
|
|
22
|
+
"@liveblocks/client": "1.1.0",
|
|
23
|
+
"@liveblocks/core": "1.1.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"zustand": "^4.1.3"
|