@liveblocks/client 0.15.8 → 0.15.9
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/lib/esm/index.js +5 -14
- package/lib/esm/index.mjs +5 -14
- package/lib/index.d.ts +9 -16
- package/lib/index.js +16 -23
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -1623,20 +1623,11 @@ function makeOthers(presenceMap) {
|
|
|
1623
1623
|
const _a = presence, publicKeys = __objRest(_a, ["_hasReceivedInitialPresence"]);
|
|
1624
1624
|
return publicKeys;
|
|
1625
1625
|
});
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
return array[Symbol.iterator]();
|
|
1632
|
-
},
|
|
1633
|
-
map(callback) {
|
|
1634
|
-
return array.map(callback);
|
|
1635
|
-
},
|
|
1636
|
-
toArray() {
|
|
1637
|
-
return array;
|
|
1638
|
-
}
|
|
1639
|
-
};
|
|
1626
|
+
const arrayish = Object.assign(array, {
|
|
1627
|
+
count: array.length,
|
|
1628
|
+
toArray: () => array
|
|
1629
|
+
});
|
|
1630
|
+
return Object.freeze(arrayish);
|
|
1640
1631
|
}
|
|
1641
1632
|
function makeStateMachine(state, context, mockedEffects) {
|
|
1642
1633
|
const effects = mockedEffects || {
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1623,20 +1623,11 @@ function makeOthers(presenceMap) {
|
|
|
1623
1623
|
const _a = presence, publicKeys = __objRest(_a, ["_hasReceivedInitialPresence"]);
|
|
1624
1624
|
return publicKeys;
|
|
1625
1625
|
});
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
return array[Symbol.iterator]();
|
|
1632
|
-
},
|
|
1633
|
-
map(callback) {
|
|
1634
|
-
return array.map(callback);
|
|
1635
|
-
},
|
|
1636
|
-
toArray() {
|
|
1637
|
-
return array;
|
|
1638
|
-
}
|
|
1639
|
-
};
|
|
1626
|
+
const arrayish = Object.assign(array, {
|
|
1627
|
+
count: array.length,
|
|
1628
|
+
toArray: () => array
|
|
1629
|
+
});
|
|
1630
|
+
return Object.freeze(arrayish);
|
|
1640
1631
|
}
|
|
1641
1632
|
function makeStateMachine(state, context, mockedEffects) {
|
|
1642
1633
|
const effects = mockedEffects || {
|
package/lib/index.d.ts
CHANGED
|
@@ -232,27 +232,20 @@ declare type Client = {
|
|
|
232
232
|
*/
|
|
233
233
|
leave(roomId: string): void;
|
|
234
234
|
};
|
|
235
|
-
|
|
236
|
-
* Represents all the other users connected in the room. Treated as immutable.
|
|
237
|
-
*/
|
|
238
|
-
interface Others<TPresence extends Presence = Presence> {
|
|
235
|
+
declare type ReadonlyArrayWithLegacyMethods<T> = readonly T[] & {
|
|
239
236
|
/**
|
|
240
|
-
*
|
|
237
|
+
* @deprecated Prefer the normal .length property on arrays.
|
|
241
238
|
*/
|
|
242
239
|
readonly count: number;
|
|
243
240
|
/**
|
|
244
|
-
*
|
|
245
|
-
*/
|
|
246
|
-
[Symbol.iterator](): IterableIterator<User<TPresence>>;
|
|
247
|
-
/**
|
|
248
|
-
* Returns the array of connected users in room.
|
|
249
|
-
*/
|
|
250
|
-
toArray(): User<TPresence>[];
|
|
251
|
-
/**
|
|
252
|
-
* This function let you map over the connected users in the room.
|
|
241
|
+
* @deprecated Calling .toArray() is no longer needed
|
|
253
242
|
*/
|
|
254
|
-
|
|
255
|
-
}
|
|
243
|
+
toArray(): T[];
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* A read-only array containing all other users connected to the room.
|
|
247
|
+
*/
|
|
248
|
+
declare type Others<P extends Presence = Presence> = ReadonlyArrayWithLegacyMethods<User<P>>;
|
|
256
249
|
/**
|
|
257
250
|
* Represents a user connected in a room. Treated as immutable.
|
|
258
251
|
*/
|
package/lib/index.js
CHANGED
|
@@ -2430,33 +2430,26 @@ function makeIdFactory(connectionId) {
|
|
|
2430
2430
|
}
|
|
2431
2431
|
|
|
2432
2432
|
function makeOthers(presenceMap) {
|
|
2433
|
-
var _ref;
|
|
2434
|
-
|
|
2435
2433
|
var array = Object.values(presenceMap).map(function (presence) {
|
|
2436
2434
|
presence._hasReceivedInitialPresence;
|
|
2437
2435
|
var publicKeys = _objectWithoutPropertiesLoose(presence, ["_hasReceivedInitialPresence"]);
|
|
2438
2436
|
|
|
2439
2437
|
return publicKeys;
|
|
2440
2438
|
});
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
}
|
|
2447
|
-
|
|
2448
|
-
}, _ref.map = function map(callback) {
|
|
2449
|
-
return array.map(callback);
|
|
2450
|
-
}, _ref.toArray = function toArray() {
|
|
2451
|
-
return array;
|
|
2452
|
-
}, _ref;
|
|
2439
|
+
var arrayish = Object.assign(array, {
|
|
2440
|
+
count: array.length,
|
|
2441
|
+
toArray: function toArray() {
|
|
2442
|
+
return array;
|
|
2443
|
+
}
|
|
2444
|
+
});
|
|
2445
|
+
return Object.freeze(arrayish);
|
|
2453
2446
|
}
|
|
2454
2447
|
|
|
2455
2448
|
function makeStateMachine(state, context, mockedEffects) {
|
|
2456
2449
|
var effects = mockedEffects || {
|
|
2457
2450
|
authenticate: function authenticate(auth, createWebSocket) {
|
|
2458
|
-
return auth(context.room).then(function (
|
|
2459
|
-
var token =
|
|
2451
|
+
return auth(context.room).then(function (_ref) {
|
|
2452
|
+
var token = _ref.token;
|
|
2460
2453
|
|
|
2461
2454
|
if (state.connection.state !== "authenticating") {
|
|
2462
2455
|
return;
|
|
@@ -2642,13 +2635,13 @@ function makeStateMachine(state, context, mockedEffects) {
|
|
|
2642
2635
|
}
|
|
2643
2636
|
}
|
|
2644
2637
|
|
|
2645
|
-
function notify(
|
|
2646
|
-
var
|
|
2647
|
-
storageUpdates =
|
|
2648
|
-
|
|
2649
|
-
presence =
|
|
2650
|
-
|
|
2651
|
-
others =
|
|
2638
|
+
function notify(_ref2) {
|
|
2639
|
+
var _ref2$storageUpdates = _ref2.storageUpdates,
|
|
2640
|
+
storageUpdates = _ref2$storageUpdates === void 0 ? new Map() : _ref2$storageUpdates,
|
|
2641
|
+
_ref2$presence = _ref2.presence,
|
|
2642
|
+
presence = _ref2$presence === void 0 ? false : _ref2$presence,
|
|
2643
|
+
_ref2$others = _ref2.others,
|
|
2644
|
+
others = _ref2$others === void 0 ? [] : _ref2$others;
|
|
2652
2645
|
|
|
2653
2646
|
if (others.length > 0) {
|
|
2654
2647
|
state.others = makeOthers(state.users);
|