@liveblocks/zustand 0.17.11 → 0.18.0-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.
- package/.built-by-link-script +1 -1
- package/index.d.ts +1 -1
- package/index.js +5 -5
- package/package.json +2 -2
package/.built-by-link-script
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d8e9090625558927999fe7eaf3b784f0dcbca9ef
|
package/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare type LiveblocksState<TState extends ZustandState, TPresence extends Json
|
|
|
25
25
|
/**
|
|
26
26
|
* Other users in the room. Empty no room is currently synced
|
|
27
27
|
*/
|
|
28
|
-
readonly others:
|
|
28
|
+
readonly others: readonly User<TPresence, TUserMeta>[];
|
|
29
29
|
/**
|
|
30
30
|
* Whether or not the room storage is currently loading
|
|
31
31
|
*/
|
package/index.js
CHANGED
|
@@ -113,7 +113,7 @@ function middleware(config, options) {
|
|
|
113
113
|
if (storageRoot) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
room = client.enter(roomId);
|
|
116
|
+
room = client.enter(roomId, { initialPresence: {} });
|
|
117
117
|
updateZustandLiveblocksState(set, {
|
|
118
118
|
isStorageLoading: true,
|
|
119
119
|
room
|
|
@@ -121,19 +121,19 @@ function middleware(config, options) {
|
|
|
121
121
|
const state = get();
|
|
122
122
|
broadcastInitialPresence(room, state, presenceMapping);
|
|
123
123
|
unsubscribeCallbacks.push(
|
|
124
|
-
room.subscribe(
|
|
124
|
+
room.events.others.subscribe(({ others }) => {
|
|
125
125
|
updateZustandLiveblocksState(set, { others: others.toArray() });
|
|
126
126
|
})
|
|
127
127
|
);
|
|
128
128
|
unsubscribeCallbacks.push(
|
|
129
|
-
room.subscribe(
|
|
129
|
+
room.events.connection.subscribe(() => {
|
|
130
130
|
updateZustandLiveblocksState(set, {
|
|
131
131
|
connection: room.getConnectionState()
|
|
132
132
|
});
|
|
133
133
|
})
|
|
134
134
|
);
|
|
135
135
|
unsubscribeCallbacks.push(
|
|
136
|
-
room.subscribe(
|
|
136
|
+
room.events.me.subscribe(() => {
|
|
137
137
|
if (isPatching === false) {
|
|
138
138
|
set(
|
|
139
139
|
patchPresenceState(room.getPresence(), presenceMapping)
|
|
@@ -203,7 +203,7 @@ function patchState(state, updates, mapping) {
|
|
|
203
203
|
for (const key in mapping) {
|
|
204
204
|
partialState[key] = state[key];
|
|
205
205
|
}
|
|
206
|
-
const patched = _internal.
|
|
206
|
+
const patched = _internal.legacy_patchImmutableObject.call(void 0, partialState, updates);
|
|
207
207
|
const result = {};
|
|
208
208
|
for (const key in mapping) {
|
|
209
209
|
result[key] = patched[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/zustand",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0-beta0",
|
|
4
4
|
"description": "A middleware to integrate Liveblocks into Zustand stores.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"directory": "packages/liveblocks-zustand"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@liveblocks/client": "0.
|
|
30
|
+
"@liveblocks/client": "0.18.0-beta0",
|
|
31
31
|
"zustand": "^3"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false
|