@emeryld/rrroutes-client 2.6.11 → 2.6.12
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.mjs
CHANGED
|
@@ -2703,7 +2703,7 @@ function roomsFromData(data, args, toRooms) {
|
|
|
2703
2703
|
let state = { rooms: [] };
|
|
2704
2704
|
const add = (input) => {
|
|
2705
2705
|
const mergeForValue = (value) => {
|
|
2706
|
-
state = mergeRoomState(state, toRooms(value,
|
|
2706
|
+
state = mergeRoomState(state, toRooms(value, args));
|
|
2707
2707
|
};
|
|
2708
2708
|
if (Array.isArray(input)) {
|
|
2709
2709
|
input.forEach((entry) => mergeForValue(entry));
|
|
@@ -2728,21 +2728,12 @@ function roomsFromData(data, args, toRooms) {
|
|
|
2728
2728
|
}
|
|
2729
2729
|
|
|
2730
2730
|
// src/sockets/socketedRoute/socket.client.helper.route.ts
|
|
2731
|
-
function isSocketClientUnavailableError(err) {
|
|
2732
|
-
return err instanceof Error && err.message.includes("SocketClient not found");
|
|
2733
|
-
}
|
|
2734
2731
|
function buildSocketedRoute(options) {
|
|
2735
2732
|
const { built, toRooms, applySocket, useSocketClient: useSocketClient2, debug } = options;
|
|
2736
2733
|
const { useEndpoint: useInnerEndpoint, ...rest } = built;
|
|
2737
2734
|
const useEndpoint = (...useArgs) => {
|
|
2738
|
-
|
|
2735
|
+
const client = useSocketClient2();
|
|
2739
2736
|
let socketClientError = null;
|
|
2740
|
-
try {
|
|
2741
|
-
client = useSocketClient2();
|
|
2742
|
-
} catch (err) {
|
|
2743
|
-
if (!isSocketClientUnavailableError(err)) throw err;
|
|
2744
|
-
socketClientError = err;
|
|
2745
|
-
}
|
|
2746
2737
|
const endpointResult = useInnerEndpoint(
|
|
2747
2738
|
...useArgs
|
|
2748
2739
|
);
|
|
@@ -2750,7 +2741,7 @@ function buildSocketedRoute(options) {
|
|
|
2750
2741
|
const [roomState, setRoomState] = useState2(
|
|
2751
2742
|
() => roomsFromData(
|
|
2752
2743
|
endpointResult.data,
|
|
2753
|
-
useArgs,
|
|
2744
|
+
useArgs[0],
|
|
2754
2745
|
toRooms
|
|
2755
2746
|
)
|
|
2756
2747
|
);
|
|
@@ -2808,7 +2799,7 @@ function buildSocketedRoute(options) {
|
|
|
2808
2799
|
setRoomState((prev) => {
|
|
2809
2800
|
const next = mergeRoomState(
|
|
2810
2801
|
prev,
|
|
2811
|
-
toRoomsRef.current(data,
|
|
2802
|
+
toRoomsRef.current(data, useArgs[0])
|
|
2812
2803
|
);
|
|
2813
2804
|
return roomStateEqual(prev, next) ? prev : next;
|
|
2814
2805
|
});
|
|
@@ -2826,7 +2817,7 @@ function buildSocketedRoute(options) {
|
|
|
2826
2817
|
toRoomsRef: describeObjectReference(toRooms)
|
|
2827
2818
|
}
|
|
2828
2819
|
});
|
|
2829
|
-
const next = roomsFromData(endpointDataRef.current, useArgs, toRooms);
|
|
2820
|
+
const next = roomsFromData(endpointDataRef.current, useArgs[0], toRooms);
|
|
2830
2821
|
setRoomState((prev) => roomStateEqual(prev, next) ? prev : next);
|
|
2831
2822
|
}, [argsKey, toRooms, debug]);
|
|
2832
2823
|
useEffect3(() => {
|
|
@@ -2956,7 +2947,7 @@ function buildSocketedRoute(options) {
|
|
|
2956
2947
|
}
|
|
2957
2948
|
const nextRoomState = roomsFromData(
|
|
2958
2949
|
next,
|
|
2959
|
-
useArgs,
|
|
2950
|
+
useArgs[0],
|
|
2960
2951
|
toRooms
|
|
2961
2952
|
);
|
|
2962
2953
|
setRoomState(
|