@evolu/react 10.2.1 → 10.4.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/useOwner.d.ts +3 -16
- package/dist/useOwner.d.ts.map +1 -1
- package/dist/useOwner.js +3 -16
- package/package.json +5 -6
- package/src/useOwner.ts +3 -16
package/dist/useOwner.d.ts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { SyncOwner } from "@evolu/common";
|
|
2
2
|
/**
|
|
3
|
-
* React Hook for
|
|
3
|
+
* React Hook for Evolu `useOwner` method.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* ### Example
|
|
9
|
-
*
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { useOwner } from "@evolu/react";
|
|
12
|
-
*
|
|
13
|
-
* function MyComponent({ shardOwner }: { shardOwner: SyncOwner | null }) {
|
|
14
|
-
* useOwner(shardOwner);
|
|
15
|
-
*
|
|
16
|
-
* // Component will sync with shardOwner while mounted
|
|
17
|
-
* return <div>Syncing with shard...</div>;
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
5
|
+
* Using an owner means syncing it with its transports, or the transports
|
|
6
|
+
* defined in Evolu config if the owner has no transports defined.
|
|
20
7
|
*/
|
|
21
8
|
export declare const useOwner: (owner: SyncOwner | null) => void;
|
|
22
9
|
//# sourceMappingURL=useOwner.d.ts.map
|
package/dist/useOwner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOwner.d.ts","sourceRoot":"","sources":["../src/useOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C
|
|
1
|
+
{"version":3,"file":"useOwner.d.ts","sourceRoot":"","sources":["../src/useOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,GAAG,IAAI,KAAG,IAOlD,CAAC"}
|
package/dist/useOwner.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { useEvolu } from "./useEvolu.js";
|
|
3
3
|
/**
|
|
4
|
-
* React Hook for
|
|
4
|
+
* React Hook for Evolu `useOwner` method.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* ### Example
|
|
10
|
-
*
|
|
11
|
-
* ```tsx
|
|
12
|
-
* import { useOwner } from "@evolu/react";
|
|
13
|
-
*
|
|
14
|
-
* function MyComponent({ shardOwner }: { shardOwner: SyncOwner | null }) {
|
|
15
|
-
* useOwner(shardOwner);
|
|
16
|
-
*
|
|
17
|
-
* // Component will sync with shardOwner while mounted
|
|
18
|
-
* return <div>Syncing with shard...</div>;
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
6
|
+
* Using an owner means syncing it with its transports, or the transports
|
|
7
|
+
* defined in Evolu config if the owner has no transports defined.
|
|
21
8
|
*/
|
|
22
9
|
export const useOwner = (owner) => {
|
|
23
10
|
const evolu = useEvolu();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolu/react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "Evolu for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"evolu",
|
|
@@ -33,14 +33,13 @@
|
|
|
33
33
|
"@types/react": "~19.1.13",
|
|
34
34
|
"@types/react-dom": "~19.1.9",
|
|
35
35
|
"react": "19.1.0",
|
|
36
|
-
"shx": "^0.4.0",
|
|
37
36
|
"typescript": "^5.9.2",
|
|
38
37
|
"vitest": "^4.0.4",
|
|
39
|
-
"@evolu/common": "7.
|
|
38
|
+
"@evolu/common": "7.4.0",
|
|
40
39
|
"@evolu/tsconfig": "0.0.2"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
|
-
"@evolu/common": "^7.
|
|
42
|
+
"@evolu/common": "^7.4.0",
|
|
44
43
|
"react": ">=19"
|
|
45
44
|
},
|
|
46
45
|
"publishConfig": {
|
|
@@ -52,8 +51,8 @@
|
|
|
52
51
|
"sideEffects": [],
|
|
53
52
|
"scripts": {
|
|
54
53
|
"dev": "tsc --watch",
|
|
55
|
-
"build": "
|
|
56
|
-
"clean": "
|
|
54
|
+
"build": "rimraf dist && tsc",
|
|
55
|
+
"clean": "rimraf .turbo node_modules dist",
|
|
57
56
|
"format": "prettier --write \"src/*.{ts,tsx,md}\""
|
|
58
57
|
}
|
|
59
58
|
}
|
package/src/useOwner.ts
CHANGED
|
@@ -3,23 +3,10 @@ import { useEffect } from "react";
|
|
|
3
3
|
import { useEvolu } from "./useEvolu.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* React Hook for
|
|
6
|
+
* React Hook for Evolu `useOwner` method.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* ### Example
|
|
12
|
-
*
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import { useOwner } from "@evolu/react";
|
|
15
|
-
*
|
|
16
|
-
* function MyComponent({ shardOwner }: { shardOwner: SyncOwner | null }) {
|
|
17
|
-
* useOwner(shardOwner);
|
|
18
|
-
*
|
|
19
|
-
* // Component will sync with shardOwner while mounted
|
|
20
|
-
* return <div>Syncing with shard...</div>;
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
8
|
+
* Using an owner means syncing it with its transports, or the transports
|
|
9
|
+
* defined in Evolu config if the owner has no transports defined.
|
|
23
10
|
*/
|
|
24
11
|
export const useOwner = (owner: SyncOwner | null): void => {
|
|
25
12
|
const evolu = useEvolu();
|