@lunora/react 1.0.0-alpha.156 → 1.0.0-alpha.158

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
@@ -101,7 +101,7 @@ function MessageList({ room }: { room: string }) {
101
101
  | `useSubscription(fn, args, options?)` | `{ data, error }` | No initial fetch — only server-pushed values. |
102
102
  | `usePaginatedQuery(fn, args, { initialNumItems, onError? })` | `{ results, status, isLoading, loadMore, error }` | Cursor-paginated feed that stays consistent under live edits. A failed tail page is dropped so `loadMore` can retry it. |
103
103
  | `useInfiniteQuery(fn, args, { initialNumItems, onError? })` | `{ pages, status, hasNextPage, fetchNextPage, error, … }` | Page-array variant of the same paginator. |
104
- | `usePreloadedQuery(preloaded, options?)` | `T` | Reads a server `Preloaded` token, then goes live. Pass `onError` to see a session expiry instead of rendering the stale SSR snapshot. |
104
+ | `usePreloadedQuery(preloaded, options?)` | `T \| undefined` | Reads a server `Preloaded` token, then goes live. Pass `onError` to see a session expiry instead of rendering the stale SSR snapshot. |
105
105
  | `usePresence(roomId, { heartbeat, listPresent, … })` | `{ present, sessionId, setData, error }` | Drives the `definePresence` heartbeat + list functions. `roomId` is a positional first argument, not an option. |
106
106
  | `useFlag(key, default)` | flag value (live) | Live OpenFeature flag over the WS; reads `default` until the server answers. Evaluated under the socket's server-verified identity. |
107
107
  | `useFlags(defaults)` | `{ [key]: value }` | Batch variant — one live value per key in the `defaults` map. |
package/dist/index.d.mts CHANGED
@@ -1055,13 +1055,14 @@ declare const useMutator: <TArgs = Record<string, unknown>>(handle: MutatorHandl
1055
1055
  * The preloaded value was read for whoever was signed in when the page loaded.
1056
1056
  * After a sign-out or user switch retires an identity, every `usePreloadedQuery`
1057
1057
  * on the client (mounted then or later) stops using it and returns `undefined`
1058
- * until the live value arrives. A token preloaded after the switch (a client-side
1059
- * navigation that preloads again) is ignored too and costs a loading flash: the
1060
- * hook cannot tell which identity a token was read under.
1058
+ * until the live value arrives — hence the `T | undefined` return type. A token
1059
+ * preloaded after the switch (a client-side navigation that preloads again) is
1060
+ * ignored too and costs a loading flash: the hook cannot tell which identity a
1061
+ * token was read under.
1061
1062
  */
1062
1063
  declare const usePreloadedQuery: <T>(preloaded: Preloaded<T>, options?: {
1063
1064
  onError?: SubscriptionErrorCallback;
1064
- }) => T;
1065
+ }) => T | undefined;
1065
1066
  /**
1066
1067
  * The PLAN4 §1 framework-neutral name for the preloaded-hydration handoff:
1067
1068
  * `hydratePreloaded(preloaded)` seeds the SSR value on the first paint, then
@@ -1075,7 +1076,7 @@ declare const usePreloadedQuery: <T>(preloaded: Preloaded<T>, options?: {
1075
1076
  */
1076
1077
  declare const hydratePreloaded: <T>(preloaded: Preloaded<T>, options?: {
1077
1078
  onError?: SubscriptionErrorCallback;
1078
- }) => T;
1079
+ }) => T | undefined;
1079
1080
  /**
1080
1081
  * `usePresence` — collaborative-awareness hook, the client half of the
1081
1082
  * `@lunora/server` `definePresence` preset (Convex `@convex-dev/presence`
package/dist/index.d.ts CHANGED
@@ -1055,13 +1055,14 @@ declare const useMutator: <TArgs = Record<string, unknown>>(handle: MutatorHandl
1055
1055
  * The preloaded value was read for whoever was signed in when the page loaded.
1056
1056
  * After a sign-out or user switch retires an identity, every `usePreloadedQuery`
1057
1057
  * on the client (mounted then or later) stops using it and returns `undefined`
1058
- * until the live value arrives. A token preloaded after the switch (a client-side
1059
- * navigation that preloads again) is ignored too and costs a loading flash: the
1060
- * hook cannot tell which identity a token was read under.
1058
+ * until the live value arrives — hence the `T | undefined` return type. A token
1059
+ * preloaded after the switch (a client-side navigation that preloads again) is
1060
+ * ignored too and costs a loading flash: the hook cannot tell which identity a
1061
+ * token was read under.
1061
1062
  */
1062
1063
  declare const usePreloadedQuery: <T>(preloaded: Preloaded<T>, options?: {
1063
1064
  onError?: SubscriptionErrorCallback;
1064
- }) => T;
1065
+ }) => T | undefined;
1065
1066
  /**
1066
1067
  * The PLAN4 §1 framework-neutral name for the preloaded-hydration handoff:
1067
1068
  * `hydratePreloaded(preloaded)` seeds the SSR value on the first paint, then
@@ -1075,7 +1076,7 @@ declare const usePreloadedQuery: <T>(preloaded: Preloaded<T>, options?: {
1075
1076
  */
1076
1077
  declare const hydratePreloaded: <T>(preloaded: Preloaded<T>, options?: {
1077
1078
  onError?: SubscriptionErrorCallback;
1078
- }) => T;
1079
+ }) => T | undefined;
1079
1080
  /**
1080
1081
  * `usePresence` — collaborative-awareness hook, the client half of the
1081
1082
  * `@lunora/server` `definePresence` preset (Convex `@convex-dev/presence`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/react",
3
- "version": "1.0.0-alpha.156",
3
+ "version": "1.0.0-alpha.158",
4
4
  "description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -57,7 +57,7 @@
57
57
  "access": "public"
58
58
  },
59
59
  "dependencies": {
60
- "@lunora/client": "1.0.0-alpha.150",
60
+ "@lunora/client": "1.0.0-alpha.151",
61
61
  "@lunora/errors": "1.0.0-alpha.45",
62
62
  "@lunora/ratelimit": "1.0.0-alpha.87",
63
63
  "@visulima/storage-client": "1.0.3"