@pluv/react 0.5.10 → 0.5.11
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/dist/index.mjs +1 -3
- package/package.json +2 -2
- package/src/createRoomBundle.tsx +3 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/react@0.5.
|
|
2
|
+
> @pluv/react@0.5.11 build /home/runner/work/pluv/pluv/packages/react
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m8.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[32m11.
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m8.60 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 98ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m11.07 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 91ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 5670ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.37 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ interface CreateRoomBundle<TIO extends IOLike, TPresence extends JsonObject, TSt
|
|
|
37
37
|
usePluvConnection: <T extends unknown = WebSocketConnection>(selector: (connection: WebSocketConnection) => T, options?: SubscriptionHookOptions<Id<T>>) => Id<T>;
|
|
38
38
|
usePluvEvent: <TType extends keyof InferIOOutput<TIO>>(type: TType, callback: (data: Id<IOEventMessage<TIO, TType>>) => void) => void;
|
|
39
39
|
usePluvMyPresence: <T extends unknown = TPresence>(selector?: (myPresence: TPresence) => T, options?: SubscriptionHookOptions<Id<T> | null>) => [
|
|
40
|
-
myPresence: Id<T
|
|
40
|
+
myPresence: Id<T>,
|
|
41
41
|
updateMyPresence: Dispatch<UpdateMyPresenceAction<TPresence>>
|
|
42
42
|
];
|
|
43
43
|
usePluvMyself: <T extends unknown = UserInfo<TIO, TPresence>>(selector?: (myself: Id<UserInfo<TIO, TPresence>>) => T, options?: SubscriptionHookOptions<Id<T> | null>) => Id<T> | null;
|
package/dist/index.js
CHANGED
|
@@ -180,9 +180,7 @@ var createRoomBundle = (client, options = {}) => {
|
|
|
180
180
|
);
|
|
181
181
|
const getSnapshot = room.getMyPresence;
|
|
182
182
|
const _selector = (0, import_react2.useCallback)(
|
|
183
|
-
(snapshot) =>
|
|
184
|
-
return !snapshot ? null : selector(snapshot);
|
|
185
|
-
},
|
|
183
|
+
(snapshot) => selector(snapshot),
|
|
186
184
|
[selector]
|
|
187
185
|
);
|
|
188
186
|
const myPresence = (0, import_with_selector.useSyncExternalStoreWithSelector)(
|
package/dist/index.mjs
CHANGED
|
@@ -150,9 +150,7 @@ var createRoomBundle = (client, options = {}) => {
|
|
|
150
150
|
);
|
|
151
151
|
const getSnapshot = room.getMyPresence;
|
|
152
152
|
const _selector = useCallback2(
|
|
153
|
-
(snapshot) =>
|
|
154
|
-
return !snapshot ? null : selector(snapshot);
|
|
155
|
-
},
|
|
153
|
+
(snapshot) => selector(snapshot),
|
|
156
154
|
[selector]
|
|
157
155
|
);
|
|
158
156
|
const myPresence = useSyncExternalStoreWithSelector(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "@pluv/client React.js bindings",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@types/use-sync-external-store": "^0.0.3",
|
|
21
21
|
"fast-deep-equal": "^3.1.3",
|
|
22
22
|
"use-sync-external-store": "^1.2.0",
|
|
23
|
-
"@pluv/client": "^0.8.
|
|
23
|
+
"@pluv/client": "^0.8.1",
|
|
24
24
|
"@pluv/types": "^0.2.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
package/src/createRoomBundle.tsx
CHANGED
|
@@ -106,7 +106,7 @@ export interface CreateRoomBundle<
|
|
|
106
106
|
selector?: (myPresence: TPresence) => T,
|
|
107
107
|
options?: SubscriptionHookOptions<Id<T> | null>
|
|
108
108
|
) => [
|
|
109
|
-
myPresence: Id<T
|
|
109
|
+
myPresence: Id<T>,
|
|
110
110
|
updateMyPresence: Dispatch<UpdateMyPresenceAction<TPresence>>
|
|
111
111
|
];
|
|
112
112
|
usePluvMyself: <T extends unknown = UserInfo<TIO, TPresence>>(
|
|
@@ -311,7 +311,7 @@ export const createRoomBundle = <
|
|
|
311
311
|
const usePluvMyPresence = <T extends unknown = TPresence>(
|
|
312
312
|
selector = identity as (myPresence: TPresence) => T,
|
|
313
313
|
options?: SubscriptionHookOptions<Id<T> | null>
|
|
314
|
-
): [Id<T
|
|
314
|
+
): [Id<T>, Dispatch<UpdateMyPresenceAction<TPresence>>] => {
|
|
315
315
|
const room = usePluvRoom();
|
|
316
316
|
|
|
317
317
|
const subscribe = useCallback(
|
|
@@ -324,9 +324,7 @@ export const createRoomBundle = <
|
|
|
324
324
|
const getSnapshot = room.getMyPresence;
|
|
325
325
|
|
|
326
326
|
const _selector = useCallback(
|
|
327
|
-
(snapshot: TPresence
|
|
328
|
-
return !snapshot ? null : (selector(snapshot) as Id<T>);
|
|
329
|
-
},
|
|
327
|
+
(snapshot: TPresence) => selector(snapshot) as Id<T>,
|
|
330
328
|
[selector]
|
|
331
329
|
);
|
|
332
330
|
|