@evolu/react 10.2.1 → 10.3.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.
@@ -1,22 +1,9 @@
1
1
  import { SyncOwner } from "@evolu/common";
2
2
  /**
3
- * React Hook for managing sync owner subscriptions.
3
+ * React Hook for Evolu `useOwner` method.
4
4
  *
5
- * When the component mounts, it registers the owner for syncing. When the
6
- * component unmounts or the owner changes, it automatically unregisters.
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
@@ -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;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,SAAS,GAAG,IAAI,KAAG,IAOlD,CAAC"}
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 managing sync owner subscriptions.
4
+ * React Hook for Evolu `useOwner` method.
5
5
  *
6
- * When the component mounts, it registers the owner for syncing. When the
7
- * component unmounts or the owner changes, it automatically unregisters.
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.2.1",
3
+ "version": "10.3.0",
4
4
  "description": "Evolu for React",
5
5
  "keywords": [
6
6
  "evolu",
@@ -36,11 +36,11 @@
36
36
  "shx": "^0.4.0",
37
37
  "typescript": "^5.9.2",
38
38
  "vitest": "^4.0.4",
39
- "@evolu/common": "7.2.1",
39
+ "@evolu/common": "7.3.0",
40
40
  "@evolu/tsconfig": "0.0.2"
41
41
  },
42
42
  "peerDependencies": {
43
- "@evolu/common": "^7.2.1",
43
+ "@evolu/common": "^7.3.0",
44
44
  "react": ">=19"
45
45
  },
46
46
  "publishConfig": {
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 managing sync owner subscriptions.
6
+ * React Hook for Evolu `useOwner` method.
7
7
  *
8
- * When the component mounts, it registers the owner for syncing. When the
9
- * component unmounts or the owner changes, it automatically unregisters.
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();