@myna-sh/react 0.3.0 → 0.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/README.md CHANGED
@@ -70,15 +70,15 @@ Each returns `{ data, error, isLoading, isValidating, refetch }` and accepts the
70
70
  | `staleMs` | How long a cached value stays fresh before a background refetch. Default 30s |
71
71
  | `suspense` | Throw the in-flight promise so a `<Suspense>` boundary handles loading |
72
72
 
73
- ## Behavior worth knowing
73
+ ## Behavior
74
74
 
75
- - **One request per query.** Components asking for the same thing share a single fetch, in-flight and across re-renders.
76
- - **A failed refresh does not blank the page.** The last good value stays in `data` alongside `error`, because content already on screen is still correct.
77
- - **Previews need no separate code path.** The provider's token flows into every read, and the server composes the collection as it would be published.
75
+ - **Requests are shared.** Components requesting the same collection with the same options produce one HTTP request.
76
+ - **A failed refresh keeps the previous value.** `data` holds the last successful result and `error` is set alongside it.
77
+ - **Preview tokens propagate.** A token on the provider's client applies to every hook beneath it, and reads return the collection as it would be published.
78
78
 
79
- ## Bring your own data layer
79
+ ## Using another data library
80
80
 
81
- If you already use TanStack Query or SWR, call `@myna-sh/sdk` directly through it instead this package exists for apps that would otherwise write the adapter by hand, not to compete with a real cache.
81
+ If your app already uses TanStack Query or SWR, call `@myna-sh/sdk` from it directly rather than adding these hooks two caches holding the same content will disagree.
82
82
 
83
83
  ## Links
84
84
 
package/dist/index.js CHANGED
@@ -175,7 +175,7 @@ function useMynaSingleton(collection, options = {}) {
175
175
  }
176
176
 
177
177
  // src/version.ts
178
- var VERSION = true ? "0.3.0" : "0.0.0-dev";
178
+ var VERSION = true ? "0.4.0" : "0.0.0-dev";
179
179
  export {
180
180
  MynaProvider,
181
181
  MynaStore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myna-sh/react",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,7 +22,7 @@
22
22
  "LICENSE"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@myna-sh/sdk": "^0.3.0",
25
+ "@myna-sh/sdk": "^0.4.0",
26
26
  "react": ">=18"
27
27
  },
28
28
  "devDependencies": {
@@ -31,8 +31,8 @@
31
31
  "eslint": "9.39.5",
32
32
  "react": "19.2.8",
33
33
  "typescript": "5.9.3",
34
- "@myna-sh/sdk": "0.3.0",
35
- "@myna-sh/config": "0.0.0"
34
+ "@myna-sh/config": "0.0.0",
35
+ "@myna-sh/sdk": "0.4.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsup",