Skip to content

Commit 322be7a

Browse files
jimmy-phantomclaude
andcommitted
Run Prettier
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d6cee29 commit 322be7a

3 files changed

Lines changed: 33 additions & 35 deletions

File tree

docs/src/app/api/fetchium/page.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ Base class for all query definitions. Extend this to define custom data-fetching
4949

5050
#### Static properties
5151

52-
| Property | Type | Description |
53-
| ------------ | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54-
| `cache` | `QueryCacheOptions \| undefined` | Class-level persistent cache settings (maxCount, cacheTime). |
55-
| `adapter` | `typeof QueryAdapter` | **(required)** The adapter class responsible for sending requests. Set automatically on `RESTQuery`. Custom query types must set this to their own adapter class. |
52+
| Property | Type | Description |
53+
| --------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54+
| `cache` | `QueryCacheOptions \| undefined` | Class-level persistent cache settings (maxCount, cacheTime). |
55+
| `adapter` | `typeof QueryAdapter` | **(required)** The adapter class responsible for sending requests. Set automatically on `RESTQuery`. Custom query types must set this to their own adapter class. |
5656

5757
#### Instance properties
5858

@@ -79,15 +79,15 @@ Convenience base class for REST/JSON queries. Handles URL construction, search p
7979

8080
#### Instance properties
8181

82-
| Property | Type | Default | Description |
83-
| ---------------- | ------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
84-
| `method` | `'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'` | `'GET'` | HTTP method. |
85-
| `path` | `string \| undefined` || URL path. Use template literal interpolation with `this.params` references. |
86-
| `searchParams` | `Record<string, unknown> \| undefined` || Query string parameters. |
87-
| `body` | `Record<string, unknown> \| undefined` || Request body (JSON-serialized). |
88-
| `headers` | `HeadersInit \| undefined` || Custom HTTP headers. |
89-
| `requestOptions` | `QueryRequestOptions \| undefined` || Additional fetch options (credentials, mode, baseUrl, etc.). |
90-
| `fetchNext` | `FetchNextConfig \| undefined` || Static pagination config. Values can be FieldRefs (e.g. `this.result.nextCursor`). |
82+
| Property | Type | Default | Description |
83+
| ---------------- | ------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- |
84+
| `method` | `'GET' \| 'POST' \| 'PUT' \| 'DELETE' \| 'PATCH'` | `'GET'` | HTTP method. |
85+
| `path` | `string \| undefined` || URL path. Use template literal interpolation with `this.params` references. |
86+
| `searchParams` | `Record<string, unknown> \| undefined` || Query string parameters. |
87+
| `body` | `Record<string, unknown> \| undefined` || Request body (JSON-serialized). |
88+
| `headers` | `HeadersInit \| undefined` || Custom HTTP headers. |
89+
| `requestOptions` | `QueryRequestOptions \| undefined` || Additional fetch options (credentials, mode, baseUrl, etc.). |
90+
| `fetchNext` | `FetchNextConfig \| undefined` || Static pagination config. Values can be FieldRefs (e.g. `this.result.nextCursor`). |
9191
| `response` | `Response \| undefined` || The raw HTTP `Response` from the last fetch. Set by `RESTQueryAdapter` after each request completes. Available in `getConfig()`. |
9292

9393
#### `getIdentityKey()` default
@@ -161,9 +161,9 @@ Base class for mutation definitions.
161161

162162
#### Static properties
163163

164-
| Property | Type | Description |
165-
| ------------ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
166-
| `adapter` | `typeof QueryAdapter` | **(required)** The adapter class that handles sending this mutation. Set automatically on `RESTMutation`. Custom mutation types must set this to their own adapter class. |
164+
| Property | Type | Description |
165+
| --------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
166+
| `adapter` | `typeof QueryAdapter` | **(required)** The adapter class that handles sending this mutation. Set automatically on `RESTMutation`. Custom mutation types must set this to their own adapter class. |
167167

168168
#### Instance properties
169169

@@ -250,21 +250,21 @@ Base class for transport adapters. An adapter handles sending queries and mutati
250250

251251
#### Methods
252252

253-
| Method | Signature | Description |
254-
| ----------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
253+
| Method | Signature | Description |
254+
| ----------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
255255
| `register` | `(queryClient: IQueryClientForAdapter): void` | Called once when the adapter is registered with a `QueryClient`. Override to do setup (e.g. open a WebSocket connection). |
256-
| `send` | `(ctx: Query, signal: AbortSignal): Promise<unknown>` | **(abstract)** Send a query and return the raw response data. |
257-
| `sendNext` | `(ctx: Query, signal: AbortSignal): Promise<unknown>` | Optional. Send the next-page request for a paginated query. |
258-
| `hasNext` | `(ctx: Query): boolean` | Optional. Return `true` if more pages are available for the current result. |
259-
| `sendMutation` | `(ctx: Mutation, signal: AbortSignal): Promise<unknown>` | Optional. Send a mutation and return the raw response data. |
260-
| `onNetworkStatusChange` | `(isOnline: boolean): void` | Optional. Called when the network comes online or goes offline. |
261-
| `destroy` | `(): void` | Optional. Called when the `QueryClient` is destroyed. Clean up connections or timers. |
256+
| `send` | `(ctx: Query, signal: AbortSignal): Promise<unknown>` | **(abstract)** Send a query and return the raw response data. |
257+
| `sendNext` | `(ctx: Query, signal: AbortSignal): Promise<unknown>` | Optional. Send the next-page request for a paginated query. |
258+
| `hasNext` | `(ctx: Query): boolean` | Optional. Return `true` if more pages are available for the current result. |
259+
| `sendMutation` | `(ctx: Mutation, signal: AbortSignal): Promise<unknown>` | Optional. Send a mutation and return the raw response data. |
260+
| `onNetworkStatusChange` | `(isOnline: boolean): void` | Optional. Called when the network comes online or goes offline. |
261+
| `destroy` | `(): void` | Optional. Called when the `QueryClient` is destroyed. Clean up connections or timers. |
262262

263263
#### Protected properties
264264

265-
| Property | Type | Description |
266-
| ------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------ |
267-
| `queryClient` | `IQueryClientForAdapter \| undefined` | Set by `register()`. Use to access the shared query context via `this.queryClient.getContext()`. |
265+
| Property | Type | Description |
266+
| ------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------ |
267+
| `queryClient` | `IQueryClientForAdapter \| undefined` | Set by `register()`. Use to access the shared query context via `this.queryClient.getContext()`. |
268268

269269
#### Example
270270

docs/src/app/setup/project-setup/page.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ The store is responsible for _persistent_ caching --- saving query results and e
4343

4444
### QueryClientConfig options
4545

46-
| Option | Type | Default | Description |
47-
| ------------- | ------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
48-
| `store` | `QueryStore` | `SyncQueryStore` (in-memory) | Persistent storage backend for query results and entity data. Defaults to an in-memory store — data is lost on page refresh. |
49-
| `adapters` | `QueryAdapter[]` | `[]` | Transport adapters. Register a `RESTQueryAdapter` to configure `fetch`, `baseUrl`, and headers for REST queries. |
50-
| `log` | `object` | `console` | A logger with `warn` and `error` methods. Fetchium uses `log.warn` for non-fatal parse failures. |
46+
| Option | Type | Default | Description |
47+
| ---------- | ---------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
48+
| `store` | `QueryStore` | `SyncQueryStore` (in-memory) | Persistent storage backend for query results and entity data. Defaults to an in-memory store — data is lost on page refresh. |
49+
| `adapters` | `QueryAdapter[]` | `[]` | Transport adapters. Register a `RESTQueryAdapter` to configure `fetch`, `baseUrl`, and headers for REST queries. |
50+
| `log` | `object` | `console` | A logger with `warn` and `error` methods. Fetchium uses `log.warn` for non-fatal parse failures. |
5151

5252
### Auto-instantiation
5353

packages/fetchium/src/__tests__/rest-query-api.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,7 @@ describe('BaseUrl and RequestOptions', () => {
708708
const store = new SyncQueryStore(new MemoryPersistentStore());
709709
const client = new QueryClient({
710710
store: store,
711-
adapters: [
712-
new RESTQueryAdapter({ fetch: mockFetch as any, baseUrl: () => 'https://dynamic.example.com' }),
713-
],
711+
adapters: [new RESTQueryAdapter({ fetch: mockFetch as any, baseUrl: () => 'https://dynamic.example.com' })],
714712
});
715713

716714
class ListUsers extends RESTQuery {

0 commit comments

Comments
 (0)