fetchium 0.2.1 → 0.2.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 (74) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/development/QueryAdapter-DUo338ga.js.map +1 -1
  3. package/dist/cjs/development/{QueryClient-vYETX2J2.js → QueryClient-BZpqASy3.js} +2 -2
  4. package/dist/cjs/development/QueryClient-BZpqASy3.js.map +1 -0
  5. package/dist/cjs/development/index.js +1 -1
  6. package/dist/cjs/{production/mutation-BnIsaYdm.js → development/mutation-COeBCn7p.js} +2 -2
  7. package/dist/cjs/development/mutation-COeBCn7p.js.map +1 -0
  8. package/dist/cjs/development/react/index.js +1 -1
  9. package/dist/cjs/development/rest/index.js +1 -1
  10. package/dist/cjs/development/topic/index.js +1 -1
  11. package/dist/cjs/development/topic/index.js.map +1 -1
  12. package/dist/cjs/production/QueryAdapter-DUo338ga.js.map +1 -1
  13. package/dist/cjs/production/{QueryClient-DJoA1ac6.js → QueryClient-BmoHLlvu.js} +2 -2
  14. package/dist/cjs/production/QueryClient-BmoHLlvu.js.map +1 -0
  15. package/dist/cjs/production/index.js +1 -1
  16. package/dist/cjs/{development/mutation-Beh3eks8.js → production/mutation-CfFdNkYV.js} +2 -2
  17. package/dist/cjs/production/mutation-CfFdNkYV.js.map +1 -0
  18. package/dist/cjs/production/react/index.js +1 -1
  19. package/dist/cjs/production/rest/index.js +1 -1
  20. package/dist/cjs/production/topic/index.js +1 -1
  21. package/dist/cjs/production/topic/index.js.map +1 -1
  22. package/dist/esm/QueryAdapter.d.ts +11 -0
  23. package/dist/esm/QueryAdapter.d.ts.map +1 -1
  24. package/dist/esm/QueryClient.d.ts +5 -5
  25. package/dist/esm/QueryClient.d.ts.map +1 -1
  26. package/dist/esm/QueryResult.d.ts.map +1 -1
  27. package/dist/esm/development/QueryAdapter-Bu5UJjE4.js.map +1 -1
  28. package/dist/esm/development/{QueryClient-zAD_O9xj.js → QueryClient-4co72n4i.js} +37 -37
  29. package/dist/esm/development/QueryClient-4co72n4i.js.map +1 -0
  30. package/dist/esm/development/index.js +2 -2
  31. package/dist/esm/development/{mutation-lw06SxbJ.js → mutation-BMAWDUP4.js} +2 -2
  32. package/dist/esm/development/mutation-BMAWDUP4.js.map +1 -0
  33. package/dist/esm/development/react/index.js +1 -1
  34. package/dist/esm/development/rest/index.js +2 -2
  35. package/dist/esm/development/topic/index.js +1 -1
  36. package/dist/esm/development/topic/index.js.map +1 -1
  37. package/dist/esm/mutation.d.ts +3 -3
  38. package/dist/esm/mutation.d.ts.map +1 -1
  39. package/dist/esm/production/QueryAdapter-Bu5UJjE4.js.map +1 -1
  40. package/dist/esm/production/{QueryClient-DSAzqTG6.js → QueryClient-CS4iUKWj.js} +32 -32
  41. package/dist/esm/production/QueryClient-CS4iUKWj.js.map +1 -0
  42. package/dist/esm/production/index.js +2 -2
  43. package/dist/esm/production/{mutation-Dmb9k9FG.js → mutation-B1EiA34B.js} +2 -2
  44. package/dist/esm/production/mutation-B1EiA34B.js.map +1 -0
  45. package/dist/esm/production/react/index.js +1 -1
  46. package/dist/esm/production/rest/index.js +2 -2
  47. package/dist/esm/production/topic/index.js +1 -1
  48. package/dist/esm/production/topic/index.js.map +1 -1
  49. package/dist/esm/query.d.ts +3 -3
  50. package/dist/esm/query.d.ts.map +1 -1
  51. package/dist/esm/topic/TopicQuery.d.ts +2 -1
  52. package/dist/esm/topic/TopicQuery.d.ts.map +1 -1
  53. package/package.json +1 -1
  54. package/plugin/docs/api/fetchium.md +2 -2
  55. package/plugin/docs/api/stores-async.md +9 -3
  56. package/plugin/docs/api/stores-sync.md +9 -3
  57. package/plugin/docs/core/entities.md +2 -2
  58. package/plugin/docs/core/queries.md +12 -19
  59. package/plugin/docs/data/mutations.md +1 -1
  60. package/plugin/docs/guides/auth.md +65 -42
  61. package/plugin/docs/guides/error-handling.md +9 -5
  62. package/plugin/docs/guides/offline.md +11 -8
  63. package/plugin/docs/guides/testing.md +1 -1
  64. package/plugin/docs/quickstart.md +1 -1
  65. package/plugin/docs/reference/rest-queries.md +9 -9
  66. package/plugin/docs/setup/project-setup.md +5 -5
  67. package/dist/cjs/development/QueryClient-vYETX2J2.js.map +0 -1
  68. package/dist/cjs/development/mutation-Beh3eks8.js.map +0 -1
  69. package/dist/cjs/production/QueryClient-DJoA1ac6.js.map +0 -1
  70. package/dist/cjs/production/mutation-BnIsaYdm.js.map +0 -1
  71. package/dist/esm/development/QueryClient-zAD_O9xj.js.map +0 -1
  72. package/dist/esm/development/mutation-lw06SxbJ.js.map +0 -1
  73. package/dist/esm/production/QueryClient-DSAzqTG6.js.map +0 -1
  74. package/dist/esm/production/mutation-Dmb9k9FG.js.map +0 -1
@@ -72,7 +72,7 @@ const client = new QueryClient();
72
72
 
73
73
  function App() {
74
74
  return (
75
- <ContextProvider value={client} context={QueryClientContext}>
75
+ <ContextProvider contexts={[[QueryClientContext, client]]}>
76
76
  <YourApp />
77
77
  </ContextProvider>
78
78
  );
@@ -32,15 +32,15 @@ class GetUserPosts extends RESTQuery {
32
32
 
33
33
  ### Method reference
34
34
 
35
- | Method | Returns | Description |
36
- | --------------------- | ----------------------------- | ---------------------------------- |
37
- | `getPath()` | `string \| undefined` | Dynamic path override |
38
- | `getMethod()` | `string` | Dynamic HTTP method |
39
- | `getSearchParams()` | `Record \| undefined` | Dynamic search params |
40
- | `getBody()` | `Record \| undefined` | Dynamic request body |
41
- | `getHeaders()` | `HeadersInit \| undefined` | Dynamic request headers |
42
- | `getRequestOptions()` | `RequestOptions \| undefined` | Dynamic fetch options |
43
- | `getConfig()` | `ConfigOptions \| undefined` | Dynamic cache/retry/network config |
35
+ | Method | Returns | Description |
36
+ | --------------------- | ---------------------------------- | ---------------------------------- |
37
+ | `getPath()` | `string \| undefined` | Dynamic path override |
38
+ | `getMethod()` | `string` | Dynamic HTTP method |
39
+ | `getSearchParams()` | `Record \| undefined` | Dynamic search params |
40
+ | `getBody()` | `Record \| undefined` | Dynamic request body |
41
+ | `getRequestOptions()` | `QueryRequestOptions \| undefined` | Dynamic fetch options |
42
+ | `getFetchNext()` | `FetchNextConfig \| undefined` | Dynamic pagination config |
43
+ | `getConfig()` | `QueryConfigOptions \| undefined` | Dynamic cache/retry/network config |
44
44
 
45
45
  ---
46
46
 
@@ -67,10 +67,10 @@ Once you need a `baseUrl`, auth headers, persistent storage, or a custom fetch w
67
67
 
68
68
  `RESTQueryAdapter` is the transport layer for all REST queries and mutations. It accepts:
69
69
 
70
- | Option | Type | Default | Description |
71
- | --------- | ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
72
- | `fetch` | `Function` | `globalThis.fetch` | The fetch function used for all network requests. Pass a custom wrapper for auth headers, logging, or testing. |
73
- | `baseUrl` | `string` | `''` | Prepended to every query path. Set this to your API root (`https://api.example.com`) so your query paths can be relative (`/users/42` instead of the full URL). |
70
+ | Option | Type | Default | Description |
71
+ | --------- | -------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
72
+ | `fetch` | `Function` | `globalThis.fetch` | The fetch function used for all network requests. Pass a custom wrapper for auth headers, logging, or testing. |
73
+ | `baseUrl` | `BaseUrlValue` | `undefined` | Prepended to every query path. Set this to your API root (`https://api.example.com`) so your query paths can be relative (`/users/42` instead of the full URL). Accepts a string, a Signalium `Signal<string>`, or a `() => string` function. |
74
74
 
75
75
  `fetch` is the _single point of control_ for how Fetchium makes network requests. Every REST query and mutation flows through this function, which means you can add authentication, logging, retry logic, or any other cross-cutting concern in one place. We cover this in depth in the [Auth & Headers](/guides/auth) guide.
76
76
 
@@ -100,7 +100,7 @@ const client = new QueryClient({
100
100
 
101
101
  function App() {
102
102
  return (
103
- <ContextProvider value={client} context={QueryClientContext}>
103
+ <ContextProvider contexts={[[QueryClientContext, client]]}>
104
104
  <YourApp />
105
105
  </ContextProvider>
106
106
  );