react-fate 1.5.0 → 1.5.2

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.
Files changed (39) hide show
  1. package/README.md +5 -7
  2. package/docs/api/functions/FateClient.md +1 -1
  3. package/docs/api/functions/clientRoot.md +1 -1
  4. package/docs/api/functions/createClient.md +1 -1
  5. package/docs/api/functions/createGraphQLTransport.md +1 -1
  6. package/docs/api/functions/createHTTPTransport.md +1 -1
  7. package/docs/api/functions/createTRPCTransport.md +1 -1
  8. package/docs/api/functions/defer.md +1 -1
  9. package/docs/api/functions/graphqlMutation.md +1 -1
  10. package/docs/api/functions/mutation.md +1 -1
  11. package/docs/api/functions/useFateClient.md +2 -2
  12. package/docs/api/functions/useListView.md +1 -1
  13. package/docs/api/functions/useLiveListView.md +1 -1
  14. package/docs/api/functions/useLiveView.md +2 -2
  15. package/docs/api/functions/useRequest.md +3 -3
  16. package/docs/api/functions/useView.md +3 -3
  17. package/docs/api/functions/view.md +1 -1
  18. package/docs/api/interfaces/Persistence.md +1 -19
  19. package/docs/api/interfaces/PersistenceSession.md +10 -10
  20. package/docs/api/type-aliases/ConnectionRef.md +1 -1
  21. package/docs/api/type-aliases/Deferred.md +1 -1
  22. package/docs/api/type-aliases/FateDehydratedState.md +1 -1
  23. package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
  24. package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
  25. package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
  26. package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
  27. package/docs/api/type-aliases/GraphQLTransportOptions.md +12 -12
  28. package/docs/api/type-aliases/HydrateOptions.md +1 -1
  29. package/docs/api/type-aliases/HydrationLimits.md +1 -1
  30. package/docs/api/type-aliases/InferFateAPI.md +1 -1
  31. package/docs/api/type-aliases/Pagination.md +5 -5
  32. package/docs/api/type-aliases/PersistenceSnapshot.md +1 -1
  33. package/docs/api/type-aliases/ViewRef.md +1 -1
  34. package/docs/api/variables/toEntityId.md +1 -1
  35. package/docs/guide/persistence.md +5 -7
  36. package/lib/client.d.mts +3 -3
  37. package/lib/index.d.mts +11 -11
  38. package/lib/vite.d.mts +3 -4
  39. package/package.json +6 -6
package/README.md CHANGED
@@ -1354,13 +1354,13 @@ Then pass `persistence` when creating the client:
1354
1354
 
1355
1355
  ```tsx
1356
1356
  import { createPersistence } from '@nkzw/fate/persistence';
1357
- import { indexedDB } from '@nkzw/fate-indexeddb';
1357
+ import { createIndexedDBStorage } from '@nkzw/fate-indexeddb';
1358
1358
  import { createFateClient } from 'react-fate/client';
1359
1359
 
1360
1360
  const fate = createFateClient({
1361
1361
  persistence: createPersistence({
1362
1362
  key: `workspace:${workspaceId}:user:${userId}`,
1363
- storage: indexedDB(),
1363
+ storage: createIndexedDBStorage(),
1364
1364
  }),
1365
1365
  url: '/api/fate',
1366
1366
  });
@@ -1373,7 +1373,7 @@ persistence: createPersistence({
1373
1373
  key: `workspace:${workspaceId}:user:${userId}`,
1374
1374
  maxAge: 24 * 60 * 60 * 1000,
1375
1375
  maxBytes: 25 * 1024 * 1024,
1376
- storage: indexedDB(),
1376
+ storage: createIndexedDBStorage(),
1377
1377
  }),
1378
1378
  ```
1379
1379
 
@@ -1545,7 +1545,7 @@ const durableHTTP = createHTTPTransport<MyAPI>({
1545
1545
 
1546
1546
  const fate = createFateClient({
1547
1547
  // ...your generated tRPC or GraphQL client options...
1548
- persistence: createPersistence({ key: accountKey, storage: indexedDB() }),
1548
+ persistence: createPersistence({ key: accountKey, storage: createIndexedDBStorage() }),
1549
1549
  mutateDurably: durableHTTP.mutateDurably,
1550
1550
  });
1551
1551
  ```
@@ -1635,7 +1635,6 @@ The core persistence layer has no IndexedDB dependency. You can use another back
1635
1635
  ```ts
1636
1636
  interface PersistenceStorage {
1637
1637
  read(key: string): Promise<unknown>;
1638
- write(key: string, value: unknown): Promise<void>;
1639
1638
  scan(
1640
1639
  prefix: string,
1641
1640
  after?: string,
@@ -1650,9 +1649,8 @@ interface PersistenceStorage {
1650
1649
  Values use fate's hydration codec and can be stored as JSON. The adapter handles storage and coordination:
1651
1650
 
1652
1651
  - `read` returns the saved value for a key.
1653
- - `write` replaces one value atomically and resolves after it has committed.
1654
1652
  - `scan` returns keys under a prefix in ascending order, strictly after the optional cursor, up to the limit (64 by default). Use your backend's ordered index to keep each scan small.
1655
- - `writeBatch` commits all entries atomically. An `undefined` value deletes the key.
1653
+ - `writeBatch` commits all entries atomically and resolves after they have committed. An `undefined` value deletes the key. Use a one-entry batch for a single write.
1656
1654
  - `exclusive` coordinates every tab or process sharing the backend. Different lock names are independent: fate holds a delivery lock during network work and acquires a separate write lock when updating storage. Your adapter must allow that nesting.
1657
1655
  - `subscribe` notifies other clients after a change commits, including keys changed by `writeBatch`. Without notifications, clients check saved mutations during delivery attempts and explicit `retry()` calls.
1658
1656
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **FateClient**(`__namedParameters`): `Element`
4
4
 
5
- Defined in: [packages/react-fate/src/context.tsx:17](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/context.tsx#L17)
5
+ Defined in: [react-fate/src/context.tsx:17](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/context.tsx#L17)
6
6
 
7
7
  Provider component that supplies a configured `FateClient` to React hooks.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **clientRoot**\<`Result`, `Type`\>(`type`): `RootDefinition`\<`Type`, `Result`\>
4
4
 
5
- Defined in: packages/fate/lib/index.d.mts:66
5
+ Defined in: fate/lib/index.d.mts:66
6
6
 
7
7
  Defines a root query for an entity type, capturing the response shape.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **createClient**\<`T`, `HydrationScope`\>(`options`): `FateClient`\<`T`\[`0`\], `T`\[`1`\], `HydrationScope`\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1445
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1457
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **createGraphQLTransport**\<`Mutations`\>(`__namedParameters`): `Transport`\<`Mutations`\>
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:62
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:62
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **createHTTPTransport**\<`API`, `Mutations`\>(`__namedParameters`): `Transport`\<`Mutations`\>
4
4
 
5
- Defined in: packages/fate/lib/index.d.mts:52
5
+ Defined in: fate/lib/index.d.mts:52
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **createTRPCTransport**\<`AppRouter`, `Mutations`\>(`__namedParameters`): `Transport`\<`MutationMapFromResolvers`\<`Mutations`\>\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1593
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1606
6
6
 
7
7
  Builds a `Transport` backed by a tRPC client using the configured resolvers
8
8
  for by-id queries, lists, and mutations.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **defer**\<`S`\>(`selection`): `DeferredSelection`\<`S`\>
4
4
 
5
- Defined in: packages/fate/lib/index.d.mts:6
5
+ Defined in: fate/lib/index.d.mts:6
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **graphqlMutation**\<`T`, `Input`, `Output`\>(`entity`, `options`): [`GraphQLMutationDefinition`](../type-aliases/GraphQLMutationDefinition.md)\<`T`, `Input`, `Output`\>
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:58
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:58
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **mutation**\<`T`, `I`, `R`\>(`entity`): `MutationDefinition`\<`T`, `I`, `R`\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:563
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:563
6
6
 
7
7
  Defines a mutation for a given entity type, preserving the input and output
8
8
  types for transports.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useFateClient**\<`T`\>(): `FateClient`\<`T`\[`0`\], `T`\[`1`\]\>
4
4
 
5
- Defined in: [packages/react-fate/src/context.tsx:30](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/context.tsx#L30)
5
+ Defined in: [react-fate/src/context.tsx:30](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/context.tsx#L30)
6
6
 
7
7
  Returns the nearest `FateClient` from context.
8
8
 
@@ -10,7 +10,7 @@ Returns the nearest `FateClient` from context.
10
10
 
11
11
  ### T
12
12
 
13
- `T` *extends* \[\{ `categories`: `RootDefinition`\<`"Category"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `category`: `RootDefinition`\<`"Category"`, `Category`[]\>; `comment`: `RootDefinition`\<`"Comment"`, `Comment`[]\>; `commentSearch`: `RootDefinition`\<`"Comment"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\> & `ConnectionResult`\<`AnyRecord`\>\>; `event`: `RootDefinition`\<`"Event"`, `Event`[]\>; `eventAttendee`: `RootDefinition`\<`"EventAttendee"`, `EventAttendee`[]\>; `events`: `RootDefinition`\<`"Event"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `post`: `RootDefinition`\<`"Post"`, `Post`[]\>; `posts`: `RootDefinition`\<`"Post"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `tag`: `RootDefinition`\<`"Tag"`, `Tag`[]\>; `user`: `RootDefinition`\<`"User"`, `User`[]\>; `viewer`: `RootDefinition`\<`"User"`, `object` & `AnyRecord` \| `null`\>; \}, \{ `comment.add`: `MutationDefinition`\<`Comment`, \{ `content`: `string`; `postId`: `string`; \}, `object` & `ItemRecord` & `object` & `object`\>; `comment.delete`: `MutationDefinition`\<`Comment`, \{ `id`: `string`; \}, `object` & `ItemRecord` & `object` & `object`\>; `post.add`: `MutationDefinition`\<`Post`, \{ `content`: `string`; `title`: `string`; \}, `Post`\>; `post.like`: `MutationDefinition`\<`Post`, \{ `error?`: `"boundary"` \| `"callSite"`; `id`: `string`; `slow?`: `boolean`; \}, `Post`\>; `post.unlike`: `MutationDefinition`\<`Post`, \{ `id`: `string`; \}, `Post`\>; `user.update`: `MutationDefinition`\<`User`, \{ `name`: `string`; \}, `AnyRecord`\>; \}\] = \[\{ `categories`: `RootDefinition`\<`"Category"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `category`: `RootDefinition`\<`"Category"`, `Category`[]\>; `comment`: `RootDefinition`\<`"Comment"`, `Comment`[]\>; `commentSearch`: `RootDefinition`\<`"Comment"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\> & `ConnectionResult`\<`AnyRecord`\>\>; `event`: `RootDefinition`\<`"Event"`, `Event`[]\>; `eventAttendee`: `RootDefinition`\<`"EventAttendee"`, `EventAttendee`[]\>; `events`: `RootDefinition`\<`"Event"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `post`: `RootDefinition`\<`"Post"`, `Post`[]\>; `posts`: `RootDefinition`\<`"Post"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `tag`: `RootDefinition`\<`"Tag"`, `Tag`[]\>; `user`: `RootDefinition`\<`"User"`, `User`[]\>; `viewer`: `RootDefinition`\<`"User"`, `object` & `AnyRecord` \| `null`\>; \}, \{ `comment.add`: `MutationDefinition`\<`Comment`, \{ `content`: `string`; `postId`: `string`; \}, `object` & `ItemRecord` & `object` & `object`\>; `comment.delete`: `MutationDefinition`\<`Comment`, \{ `id`: `string`; \}, `object` & `ItemRecord` & `object` & `object`\>; `post.add`: `MutationDefinition`\<`Post`, \{ `content`: `string`; `title`: `string`; \}, `Post`\>; `post.like`: `MutationDefinition`\<`Post`, \{ `error?`: `"boundary"` \| `"callSite"`; `id`: `string`; `slow?`: `boolean`; \}, `Post`\>; `post.unlike`: `MutationDefinition`\<`Post`, \{ `id`: `string`; \}, `Post`\>; `user.update`: `MutationDefinition`\<`User`, \{ `name`: `string`; \}, `AnyRecord`\>; \}\]
13
+ `T` *extends* \[`FateRoots`, `FateMutations`\] = \[`FateRoots`, `FateMutations`\]
14
14
 
15
15
  ## Returns
16
16
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useListView**\<`C`\>(`selection`, `connection`): \[`ConnectionItems`\<`ResolvedConnection`\<`C`\>\>, `LoadMoreFn` \| `null`, `LoadMoreFn` \| `null`\]
4
4
 
5
- Defined in: [packages/react-fate/src/useListView.tsx:19](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useListView.tsx#L19)
5
+ Defined in: [react-fate/src/useListView.tsx:19](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useListView.tsx#L19)
6
6
 
7
7
  Subscribes to a connection field, returning the current items and pagination
8
8
  helpers to load the next or previous page.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useLiveListView**\<`C`\>(`selection`, `connection`): \[`ConnectionItems`\<`ResolvedConnection`\<`C`\>\>, `LoadMoreFn` \| `null`, `LoadMoreFn` \| `null`\]
4
4
 
5
- Defined in: [packages/react-fate/src/useLiveListView.tsx:19](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useLiveListView.tsx#L19)
5
+ Defined in: [react-fate/src/useLiveListView.tsx:19](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useLiveListView.tsx#L19)
6
6
 
7
7
  Subscribes to a connection field, returning live-updating items and pagination
8
8
  helpers to load the next or previous page.
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **useLiveView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
6
6
 
7
- Defined in: [packages/react-fate/src/useLiveView.tsx:27](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useLiveView.tsx#L27)
7
+ Defined in: [react-fate/src/useLiveView.tsx:27](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useLiveView.tsx#L27)
8
8
 
9
9
  Resolves a reference against a view and subscribes to live server updates for
10
10
  that selection.
@@ -43,7 +43,7 @@ const post = useLiveView(PostView, postRef);
43
43
 
44
44
  > **useLiveView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
45
45
 
46
- Defined in: [packages/react-fate/src/useLiveView.tsx:31](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useLiveView.tsx#L31)
46
+ Defined in: [react-fate/src/useLiveView.tsx:31](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useLiveView.tsx#L31)
47
47
 
48
48
  Resolves a reference against a view and subscribes to live server updates for
49
49
  that selection.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **useRequest**\<`R`, `O`\>(`request`, `options?`): `RequestResult`\<`O`, `R`\>
4
4
 
5
- Defined in: [packages/react-fate/src/useRequest.tsx:25](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useRequest.tsx#L25)
5
+ Defined in: [react-fate/src/useRequest.tsx:25](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useRequest.tsx#L25)
6
6
 
7
7
  Declares the data a screen needs and kicks off fetching, suspending while the
8
8
  request resolves.
@@ -15,7 +15,7 @@ request resolves.
15
15
 
16
16
  ### O
17
17
 
18
- `O` *extends* `FateRoots` = \{ `categories`: `RootDefinition`\<`"Category"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `category`: `RootDefinition`\<`"Category"`, `Category`[]\>; `comment`: `RootDefinition`\<`"Comment"`, `Comment`[]\>; `commentSearch`: `RootDefinition`\<`"Comment"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\> & `ConnectionResult`\<`AnyRecord`\>\>; `event`: `RootDefinition`\<`"Event"`, `Event`[]\>; `eventAttendee`: `RootDefinition`\<`"EventAttendee"`, `EventAttendee`[]\>; `events`: `RootDefinition`\<`"Event"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `post`: `RootDefinition`\<`"Post"`, `Post`[]\>; `posts`: `RootDefinition`\<`"Post"`, `ConnectionResult`\<\{\[`key`: `string`\]: `any`; \}\>\>; `tag`: `RootDefinition`\<`"Tag"`, `Tag`[]\>; `user`: `RootDefinition`\<`"User"`, `User`[]\>; `viewer`: `RootDefinition`\<`"User"`, `object` & `AnyRecord` \| `null`\>; \}
18
+ `O` *extends* `FateRoots` = `FateRoots`
19
19
 
20
20
  ## Parameters
21
21
 
@@ -25,7 +25,7 @@ request resolves.
25
25
 
26
26
  ### options?
27
27
 
28
- `Readonly`\<\{ `mode?`: `RequestMode`; `persist?`: \{ `maxAge`: `number`; \}; \}\>
28
+ `Readonly`\<\{ `mode?`: `RequestMode`; `persist?`: `Readonly`\<\{ `maxAge`: `number`; \}\>; \}\>
29
29
 
30
30
  ## Returns
31
31
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **useView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
6
6
 
7
- Defined in: [packages/react-fate/src/useView.tsx:40](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useView.tsx#L40)
7
+ Defined in: [react-fate/src/useView.tsx:40](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useView.tsx#L40)
8
8
 
9
9
  Resolves a reference against a view and subscribes to updates for that selection.
10
10
 
@@ -42,7 +42,7 @@ const post = useView(PostView, postRef);
42
42
 
43
43
  > **useView**\<`V`, `R`\>(`view`, `ref`): `R` *extends* `null` ? `null` : `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\>
44
44
 
45
- Defined in: [packages/react-fate/src/useView.tsx:44](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useView.tsx#L44)
45
+ Defined in: [react-fate/src/useView.tsx:44](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useView.tsx#L44)
46
46
 
47
47
  Resolves a reference against a view and subscribes to updates for that selection.
48
48
 
@@ -80,7 +80,7 @@ const post = useView(PostView, postRef);
80
80
 
81
81
  > **useView**\<`V`\>(`view`, `ref`): `Readonly`\<`ViewSelection`\<`V`\> *extends* `Selection`\<`ViewEntityWithTypename`\<`V`\>\> ? `Mask`\<`ViewEntityWithTypename`\<`V`\>, \{ \[K in string \| number \| symbol as K extends "\_\_typename" ? never : K\]?: DeferrableSelectionFieldValue\<ViewEntityWithTypename\<V\>, K\> \} & `object` & `SelectionViewSpread`\<`ViewEntityWithTypename`\<`V`\>\> & `ViewSelection`\<`V`\>\> : `ViewEntityWithTypename`\<`V`\> & `object`\> \| `null`
82
82
 
83
- Defined in: [packages/react-fate/src/useView.tsx:48](https://github.com/nkzw-tech/fate/blob/0dec4f3068f60a4fbf85796c9934f6112afe09a2/packages/react-fate/src/useView.tsx#L48)
83
+ Defined in: [react-fate/src/useView.tsx:48](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/react-fate/src/useView.tsx#L48)
84
84
 
85
85
  Resolves a reference against a view and subscribes to updates for that selection.
86
86
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **view**\<`T`\>(): \<`S`\>(`select`) => `View`\<`T`, `S`\>
4
4
 
5
- Defined in: packages/fate/lib/index.d.mts:85
5
+ Defined in: fate/lib/index.d.mts:85
6
6
 
7
7
  Creates a reusable view for an object using the declared selection.
8
8
 
@@ -1,23 +1,5 @@
1
1
  # Interface: Persistence
2
2
 
3
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1455
3
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1468
4
4
 
5
5
  A persistence integration. Implementations are imported separately from Fate core.
6
-
7
- ## Methods
8
-
9
- ### attach()
10
-
11
- > **attach**(`client`): [`PersistenceSession`](PersistenceSession.md)
12
-
13
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1456
14
-
15
- #### Parameters
16
-
17
- ##### client
18
-
19
- `FateClient`\<`any`, `any`, `any`\>
20
-
21
- #### Returns
22
-
23
- [`PersistenceSession`](PersistenceSession.md)
@@ -1,8 +1,8 @@
1
1
  # Interface: PersistenceSession
2
2
 
3
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1474
3
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1488
4
4
 
5
- Observability and lifecycle of an attached persistence integration.
5
+ User-facing observability and lifecycle of an attached persistence integration.
6
6
 
7
7
  ## Properties
8
8
 
@@ -10,7 +10,7 @@ Observability and lifecycle of an attached persistence integration.
10
10
 
11
11
  > `readonly` **ready**: `Promise`\<`void`\>
12
12
 
13
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1486
13
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1494
14
14
 
15
15
  ## Methods
16
16
 
@@ -18,7 +18,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1486
18
18
 
19
19
  > **clearCache**(): `Promise`\<`void`\>
20
20
 
21
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1477
21
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1489
22
22
 
23
23
  #### Returns
24
24
 
@@ -30,7 +30,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1477
30
30
 
31
31
  > **discard**(`id`): `Promise`\<`void`\>
32
32
 
33
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1478
33
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1490
34
34
 
35
35
  #### Parameters
36
36
 
@@ -48,7 +48,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1478
48
48
 
49
49
  > **dispose**(): `void`
50
50
 
51
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1479
51
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1491
52
52
 
53
53
  #### Returns
54
54
 
@@ -60,7 +60,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1479
60
60
 
61
61
  > **flush**(): `Promise`\<`void`\>
62
62
 
63
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1482
63
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1492
64
64
 
65
65
  #### Returns
66
66
 
@@ -72,7 +72,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1482
72
72
 
73
73
  > **getSnapshot**(): [`PersistenceSnapshot`](../type-aliases/PersistenceSnapshot.md)
74
74
 
75
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1483
75
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1493
76
76
 
77
77
  #### Returns
78
78
 
@@ -84,7 +84,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1483
84
84
 
85
85
  > **retry**(): `void`
86
86
 
87
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1489
87
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1495
88
88
 
89
89
  #### Returns
90
90
 
@@ -96,7 +96,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1489
96
96
 
97
97
  > **subscribe**(`listener`): () => `void`
98
98
 
99
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1490
99
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1496
100
100
 
101
101
  #### Parameters
102
102
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ConnectionRef**\<`TName`\> = `Readonly`\<\{ `items`: `ReadonlyArray`\<\{ `cursor?`: `string`; `node`: [`ViewRef`](ViewRef.md)\<`TName`\>; \}\>; `pagination?`: [`Pagination`](Pagination.md); \}\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:743
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:743
6
6
 
7
7
  Ref for a connection, including pagination metadata.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Deferred**\<`T`\> = `Readonly`\<\{ `[DeferredTag]`: `DeferredMetadata`; \}\> & `object`
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:763
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:763
6
6
 
7
7
  A deferred value returned from a masked view. Existing view hooks resolve it when read.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **FateDehydratedState**\<`Scope`\> = `Readonly`\<\{ `[hydrationScopeBrand]?`: `Scope`; `data`: `FateSerializedValue`; `scope`: `Scope`; `version`: `1`; \}\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1163
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1174
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **GraphQLMutationDefinition**\<`T`, `Input`, `Output`\> = `Readonly`\<\{ `__fateGraphQLMutation?`: \{ `input`: `Input`; `output`: `Output`; \}; `entity`: `T`\[`"__typename"`\]; `field`: `string`; `inputArg?`: `false` \| `string`; \}\>
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:19
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:19
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **GraphQLMutationInput**\<`Definition`\> = `Definition` *extends* [`GraphQLMutationDefinition`](GraphQLMutationDefinition.md)\<`any`, infer Input, `any`\> ? `Input` : `never`
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:28
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:28
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **GraphQLMutationMap**\<`Mutations`\> = `Mutations` *extends* `Record`\<`string`, [`GraphQLMutationDefinition`](GraphQLMutationDefinition.md)\> ? `{ [K in keyof Mutations]: { input: GraphQLMutationInput<Mutations[K]>; output: GraphQLMutationOutput<Mutations[K]> } }` : `EmptyTransportMutations`
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:30
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:30
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **GraphQLMutationOutput**\<`Definition`\> = `Definition` *extends* [`GraphQLMutationDefinition`](GraphQLMutationDefinition.md)\<`any`, `any`, infer Output\> ? `Output` : `never`
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:29
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:29
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **GraphQLTransportOptions**\<`Mutations`\> = `object`
4
4
 
5
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:45
5
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:45
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -16,7 +16,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:45
16
16
 
17
17
  > `optional` **decodeNodeId?**: (`type`, `id`) => `string` \| `number`
18
18
 
19
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:46
19
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:46
20
20
 
21
21
  #### Parameters
22
22
 
@@ -38,7 +38,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:46
38
38
 
39
39
  > `optional` **encodeNodeId?**: (`type`, `id`) => `string` \| `number`
40
40
 
41
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:47
41
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:47
42
42
 
43
43
  #### Parameters
44
44
 
@@ -60,7 +60,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:47
60
60
 
61
61
  > `optional` **eventSource?**: `EventSourceConstructor`
62
62
 
63
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:48
63
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:48
64
64
 
65
65
  ***
66
66
 
@@ -68,7 +68,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:48
68
68
 
69
69
  > `optional` **fetch?**: `FetchLike`
70
70
 
71
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:49
71
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:49
72
72
 
73
73
  ***
74
74
 
@@ -76,7 +76,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:49
76
76
 
77
77
  > `optional` **headers?**: `HeadersFactory`
78
78
 
79
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:50
79
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:50
80
80
 
81
81
  ***
82
82
 
@@ -84,7 +84,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:50
84
84
 
85
85
  > `optional` **live?**: `boolean` \| `GraphQLLiveOptions`
86
86
 
87
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:51
87
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:51
88
88
 
89
89
  ***
90
90
 
@@ -92,7 +92,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:51
92
92
 
93
93
  > `optional` **mutateDurably?**: `Transport`\<`Mutations`\>\[`"mutateDurably"`\]
94
94
 
95
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:52
95
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:52
96
96
 
97
97
  ***
98
98
 
@@ -100,7 +100,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:52
100
100
 
101
101
  > `optional` **mutations?**: `Record`\<`Extract`\<keyof `Mutations`, `string`\>, `GraphQLMutationRuntimeConfig`\>
102
102
 
103
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:53
103
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:53
104
104
 
105
105
  ***
106
106
 
@@ -108,7 +108,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:53
108
108
 
109
109
  > `optional` **roots?**: `Record`\<`string`, `GraphQLRootConfig`\>
110
110
 
111
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:54
111
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:54
112
112
 
113
113
  ***
114
114
 
@@ -116,7 +116,7 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:54
116
116
 
117
117
  > **types**: `ReadonlyArray`\<`Omit`\<`TypeConfig`, `"getId"`\> & `Partial`\<`Pick`\<`TypeConfig`, `"getId"`\>\>\>
118
118
 
119
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:55
119
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:55
120
120
 
121
121
  ***
122
122
 
@@ -124,4 +124,4 @@ Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:55
124
124
 
125
125
  > **url**: `string` \| `URL`
126
126
 
127
- Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:56
127
+ Defined in: fate/lib/graphqlTransport-CGYE4NdD.d.mts:56
@@ -2,6 +2,6 @@
2
2
 
3
3
  > **HydrateOptions** = `Readonly`\<\{ `merge?`: `"preserve-existing"` \| `"replace"`; \}\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1170
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1181
6
6
 
7
7
  Controls how `FateClient.hydrate()` reconciles a snapshot with browser cache state.
@@ -2,6 +2,6 @@
2
2
 
3
3
  > **HydrationLimits** = `Readonly`\<\{ `maxCollectionLength`: `number`; `maxNodes`: `number`; `maxStringLength`: `number`; \}\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1180
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1191
6
6
 
7
7
  Resource limits applied while encoding and decoding hydration snapshots.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **InferFateAPI**\<`Server`\> = `Server` *extends* `object` ? `API` : `never`
4
4
 
5
- Defined in: packages/fate/lib/record-DITM4zb\_.d.mts:208
5
+ Defined in: fate/lib/record-Dxjvpsep.d.mts:208
6
6
 
7
7
  ## Type Parameters
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Pagination** = `object`
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:736
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:736
6
6
 
7
7
  Pagination state returned alongside connection lists.
8
8
 
@@ -12,7 +12,7 @@ Pagination state returned alongside connection lists.
12
12
 
13
13
  > **hasNext**: `boolean`
14
14
 
15
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:737
15
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:737
16
16
 
17
17
  ***
18
18
 
@@ -20,7 +20,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:737
20
20
 
21
21
  > **hasPrevious**: `boolean`
22
22
 
23
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:738
23
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:738
24
24
 
25
25
  ***
26
26
 
@@ -28,7 +28,7 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:738
28
28
 
29
29
  > `optional` **nextCursor?**: `string`
30
30
 
31
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:739
31
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:739
32
32
 
33
33
  ***
34
34
 
@@ -36,4 +36,4 @@ Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:739
36
36
 
37
37
  > `optional` **previousCursor?**: `string`
38
38
 
39
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:740
39
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:740
@@ -2,4 +2,4 @@
2
2
 
3
3
  > **PersistenceSnapshot** = `Readonly`\<\{ `error?`: `Error`; `mutations`: `ReadonlyArray`\<`PersistedMutationStatus`\>; `status`: `"restoring"` \| `"ready"` \| `"error"` \| `"disposed"`; \}\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1465
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:1479
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewRef**\<`TName`\> = `Readonly`\<\{ `__typename`: `TName`; `[ViewsTag]`: `Set`\<`string`\>; `id`: `string` \| `number`; \}\>
4
4
 
5
- Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:712
5
+ Defined in: fate/lib/transport-DR0fwleU.d.mts:712
6
6
 
7
7
  Reference to a normalized entity instance that can be resolved against one or more view tags.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > `const` **toEntityId**: (`type`, `rawId`) => `EntityId`
4
4
 
5
- Defined in: packages/fate/lib/index.d.mts:72
5
+ Defined in: fate/lib/index.d.mts:72
6
6
 
7
7
  Builds the canonical cache ID for an entity.
8
8
 
@@ -16,13 +16,13 @@ Then pass `persistence` when creating the client:
16
16
 
17
17
  ```tsx
18
18
  import { createPersistence } from '@nkzw/fate/persistence';
19
- import { indexedDB } from '@nkzw/fate-indexeddb';
19
+ import { createIndexedDBStorage } from '@nkzw/fate-indexeddb';
20
20
  import { createFateClient } from 'react-fate/client';
21
21
 
22
22
  const fate = createFateClient({
23
23
  persistence: createPersistence({
24
24
  key: `workspace:${workspaceId}:user:${userId}`,
25
- storage: indexedDB(),
25
+ storage: createIndexedDBStorage(),
26
26
  }),
27
27
  url: '/api/fate',
28
28
  });
@@ -35,7 +35,7 @@ persistence: createPersistence({
35
35
  key: `workspace:${workspaceId}:user:${userId}`,
36
36
  maxAge: 24 * 60 * 60 * 1000,
37
37
  maxBytes: 25 * 1024 * 1024,
38
- storage: indexedDB(),
38
+ storage: createIndexedDBStorage(),
39
39
  }),
40
40
  ```
41
41
 
@@ -207,7 +207,7 @@ const durableHTTP = createHTTPTransport<MyAPI>({
207
207
 
208
208
  const fate = createFateClient({
209
209
  // ...your generated tRPC or GraphQL client options...
210
- persistence: createPersistence({ key: accountKey, storage: indexedDB() }),
210
+ persistence: createPersistence({ key: accountKey, storage: createIndexedDBStorage() }),
211
211
  mutateDurably: durableHTTP.mutateDurably,
212
212
  });
213
213
  ```
@@ -297,7 +297,6 @@ The core persistence layer has no IndexedDB dependency. You can use another back
297
297
  ```ts
298
298
  interface PersistenceStorage {
299
299
  read(key: string): Promise<unknown>;
300
- write(key: string, value: unknown): Promise<void>;
301
300
  scan(
302
301
  prefix: string,
303
302
  after?: string,
@@ -312,9 +311,8 @@ interface PersistenceStorage {
312
311
  Values use fate's hydration codec and can be stored as JSON. The adapter handles storage and coordination:
313
312
 
314
313
  - `read` returns the saved value for a key.
315
- - `write` replaces one value atomically and resolves after it has committed.
316
314
  - `scan` returns keys under a prefix in ascending order, strictly after the optional cursor, up to the limit (64 by default). Use your backend's ordered index to keep each scan small.
317
- - `writeBatch` commits all entries atomically. An `undefined` value deletes the key.
315
+ - `writeBatch` commits all entries atomically and resolves after they have committed. An `undefined` value deletes the key. Use a one-entry batch for a single write.
318
316
  - `exclusive` coordinates every tab or process sharing the backend. Different lock names are independent: fate holds a delivery lock during network work and acquires a separate write lock when updating storage. Your adapter must allow that nesting.
319
317
  - `subscribe` notifies other clients after a change commits, including keys changed by `writeBatch`. Without notifications, clients check saved mutations during delivery attempts and explicit `retry()` calls.
320
318
 
package/lib/client.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createFateClient } from "@nkzw/fate/client";
2
2
  //#region src/client.d.ts
3
- interface ClientMutations {}
4
- interface ClientRoots {}
3
+ export interface ClientMutations {}
4
+ export interface ClientRoots {}
5
5
  //#endregion
6
- export { ClientMutations, ClientRoots, createFateClient };
6
+ export { createFateClient };
package/lib/index.d.mts CHANGED
@@ -10,7 +10,7 @@ type Roots = [GeneratedFateClient$1] extends [never] ? FateRoots : GeneratedFate
10
10
  * @example
11
11
  * const { posts } = useRequest({ posts: { list: PostView } });
12
12
  */
13
- declare function useRequest<R extends Request, O extends FateRoots = Roots>(request: R, options?: RequestOptions): RequestResult<O, R>;
13
+ export declare function useRequest<R extends Request, O extends FateRoots = Roots>(request: R, options?: RequestOptions): RequestResult<O, R>;
14
14
  //#endregion
15
15
  //#region src/context.d.ts
16
16
  type GeneratedFateClient = ReturnType<typeof import('react-fate/client').createFateClient>;
@@ -18,14 +18,14 @@ type Mutations = [GeneratedFateClient] extends [never] ? FateMutations : Generat
18
18
  /**
19
19
  * Provider component that supplies a configured `FateClient` to React hooks.
20
20
  */
21
- declare function FateClient({ children, client }: {
21
+ export declare function FateClient({ children, client }: {
22
22
  children: ReactNode;
23
23
  client: FateClient$1<any, any>;
24
24
  }): import("react").JSX.Element;
25
25
  /**
26
26
  * Returns the nearest `FateClient` from context.
27
27
  */
28
- declare function useFateClient<T extends [Roots, Mutations] = [Roots, Mutations]>(): FateClient$1<T[0], T[1]>;
28
+ export declare function useFateClient<T extends [Roots, Mutations] = [Roots, Mutations]>(): FateClient$1<T[0], T[1]>;
29
29
  //#endregion
30
30
  //#region src/useLiveView.d.ts
31
31
  type ViewEntityWithTypename$1<V extends View<any, any>> = ViewEntity<V> & {
@@ -38,8 +38,8 @@ type ViewEntityWithTypename$1<V extends View<any, any>> = ViewEntity<V> & {
38
38
  * @example
39
39
  * const post = useLiveView(PostView, postRef);
40
40
  */
41
- declare function useLiveView<V extends View<any, any>, R extends ViewRef$1<ViewEntityName<V>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename$1<V>, ViewSelection<V>>;
42
- declare function useLiveView<V extends View<any, any>, R extends Deferred$1<ViewRef$1<ViewEntityName<V>>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename$1<V>, ViewSelection<V>>;
41
+ export declare function useLiveView<V extends View<any, any>, R extends ViewRef$1<ViewEntityName<V>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename$1<V>, ViewSelection<V>>;
42
+ export declare function useLiveView<V extends View<any, any>, R extends Deferred$1<ViewRef$1<ViewEntityName<V>>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename$1<V>, ViewSelection<V>>;
43
43
  //#endregion
44
44
  //#region src/listView.d.ts
45
45
  type ConnectionItems<C> = C extends {
@@ -62,7 +62,7 @@ type ResolvedConnection$1<C> = C extends Deferred$1<infer Value> ? Value : NonNu
62
62
  * Subscribes to a connection field, returning live-updating items and pagination
63
63
  * helpers to load the next or previous page.
64
64
  */
65
- declare function useLiveListView<C extends ConnectionValue$1 | Deferred$1<ConnectionValue$1> | null | undefined>(selection: ConnectionSelection, connection: C): [ConnectionItems<ResolvedConnection$1<C>>, LoadMoreFn | null, LoadMoreFn | null];
65
+ export declare function useLiveListView<C extends ConnectionValue$1 | Deferred$1<ConnectionValue$1> | null | undefined>(selection: ConnectionSelection, connection: C): [ConnectionItems<ResolvedConnection$1<C>>, LoadMoreFn | null, LoadMoreFn | null];
66
66
  //#endregion
67
67
  //#region src/useView.d.ts
68
68
  type ViewEntityWithTypename<V extends View<any, any>> = ViewEntity<V> & {
@@ -74,9 +74,9 @@ type ViewEntityWithTypename<V extends View<any, any>> = ViewEntity<V> & {
74
74
  * @example
75
75
  * const post = useView(PostView, postRef);
76
76
  */
77
- declare function useView<V extends View<any, any>, R extends ViewRef$1<ViewEntityName<V>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename<V>, ViewSelection<V>>;
78
- declare function useView<V extends View<any, any>, R extends Deferred$1<ViewRef$1<ViewEntityName<V>>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename<V>, ViewSelection<V>>;
79
- declare function useView<V extends View<any, any>>(view: V, ref: Deferred$1<ViewRef$1<ViewEntityName<V>>> | ViewRef$1<ViewEntityName<V>> | null): ViewData<ViewEntityWithTypename<V>, ViewSelection<V>> | null;
77
+ export declare function useView<V extends View<any, any>, R extends ViewRef$1<ViewEntityName<V>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename<V>, ViewSelection<V>>;
78
+ export declare function useView<V extends View<any, any>, R extends Deferred$1<ViewRef$1<ViewEntityName<V>>> | null>(view: V, ref: R): R extends null ? null : ViewData<ViewEntityWithTypename<V>, ViewSelection<V>>;
79
+ export declare function useView<V extends View<any, any>>(view: V, ref: Deferred$1<ViewRef$1<ViewEntityName<V>>> | ViewRef$1<ViewEntityName<V>> | null): ViewData<ViewEntityWithTypename<V>, ViewSelection<V>> | null;
80
80
  //#endregion
81
81
  //#region src/useListView.d.ts
82
82
  type ConnectionValue = {
@@ -88,6 +88,6 @@ type ResolvedConnection<C> = C extends Deferred$1<infer Value> ? Value : NonNull
88
88
  * Subscribes to a connection field, returning the current items and pagination
89
89
  * helpers to load the next or previous page.
90
90
  */
91
- declare function useListView<C extends ConnectionValue | Deferred$1<ConnectionValue> | null | undefined>(selection: ConnectionSelection, connection: C): [ConnectionItems<ResolvedConnection<C>>, LoadMoreFn | null, LoadMoreFn | null];
91
+ export declare function useListView<C extends ConnectionValue | Deferred$1<ConnectionValue> | null | undefined>(selection: ConnectionSelection, connection: C): [ConnectionItems<ResolvedConnection<C>>, LoadMoreFn | null, LoadMoreFn | null];
92
92
  //#endregion
93
- export { type ConnectionRef, type Deferred, FateClient, type FateDehydratedState, type GraphQLMutationDefinition, type GraphQLMutationInput, type GraphQLMutationMap, type GraphQLMutationOutput, type GraphQLTransportOptions, type HydrateOptions, type HydrationLimits, type InferFateAPI, type Pagination, type Persistence, type PersistenceSession, type PersistenceSnapshot, type ViewRef, clientRoot, createClient, createGraphQLTransport, createHTTPTransport, createTRPCTransport, defer, graphqlMutation, mutation, toEntityId, useFateClient, useListView, useLiveListView, useLiveView, useRequest, useView, view };
93
+ export { type ConnectionRef, type Deferred, type FateDehydratedState, type GraphQLMutationDefinition, type GraphQLMutationInput, type GraphQLMutationMap, type GraphQLMutationOutput, type GraphQLTransportOptions, type HydrateOptions, type HydrationLimits, type InferFateAPI, type Pagination, type Persistence, type PersistenceSession, type PersistenceSnapshot, type ViewRef, clientRoot, createClient, createGraphQLTransport, createHTTPTransport, createTRPCTransport, defer, graphqlMutation, mutation, toEntityId, view };
package/lib/vite.d.mts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { FateViteTransport, fate as fate$1 } from "@nkzw/fate/vite";
2
2
  //#region src/vite.d.ts
3
- type FateVitePluginOptions = {
3
+ export type FateVitePluginOptions = {
4
4
  generatedFile?: false | string;
5
5
  module: string;
6
6
  transport?: FateViteTransport;
7
7
  tsconfigFile?: false | string;
8
8
  };
9
- declare const fate: (options: FateVitePluginOptions) => ReturnType<typeof fate$1>;
10
- //#endregion
11
- export { FateVitePluginOptions, fate };
9
+ export declare const fate: (options: FateVitePluginOptions) => ReturnType<typeof fate$1>;
10
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-fate",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "fate is a modern data client for React.",
5
5
  "homepage": "https://github.com/nkzw-tech/fate",
6
6
  "license": "MIT",
@@ -40,13 +40,13 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "@nkzw/fate": "^1.5.0"
43
+ "@nkzw/fate": "^1.5.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@types/react": "^19.2.18",
47
- "@types/react-dom": "^19.2.7",
48
- "react": "^19.2.8",
49
- "react-dom": "^19.2.8"
46
+ "@types/react": "^19.3.0",
47
+ "@types/react-dom": "^19.3.0",
48
+ "react": "^19.3.0",
49
+ "react-dom": "^19.3.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": "^19.2.0",