@tiesen/effect-tanstack-query 0.0.9 → 0.0.11
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
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as TanstackQueryOptionsProxy } from "./types-
|
|
1
|
+
import { r as TanstackQueryOptionsProxy } from "./types-CCJtD9mu.mjs";
|
|
2
2
|
import { Service } from "effect/Context";
|
|
3
3
|
import { ManagedRuntime } from "effect/ManagedRuntime";
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -21,10 +21,10 @@ import { ManagedRuntime } from "effect/ManagedRuntime";
|
|
|
21
21
|
* class Api extends HttpApi.make('Api').add(ApiGroup) {}
|
|
22
22
|
*
|
|
23
23
|
* class ApiClient extends Context.Service<ApiClient, HttpApiClient.ForApi<typeof Api>>()('ApiClient') {
|
|
24
|
-
* public static
|
|
24
|
+
* public static layer = Layer.effect(this, HttpApiClient.make(Api)).pipe(Layer.provide(FetchHttpClient.layer))
|
|
25
25
|
* }
|
|
26
26
|
*
|
|
27
|
-
* const runtime = ManagedRuntime.make(ApiClient.
|
|
27
|
+
* const runtime = ManagedRuntime.make(ApiClient.layer)
|
|
28
28
|
* const api = createTanstackQueryOptionsProxy(ApiClient, runtime);
|
|
29
29
|
*
|
|
30
30
|
* // Example usage in a React component with TanStack Query
|
|
@@ -37,7 +37,7 @@ import { ManagedRuntime } from "effect/ManagedRuntime";
|
|
|
37
37
|
*
|
|
38
38
|
* useSubscription(api.stream.subscriptionOptions({
|
|
39
39
|
* onData: (data) => console.log(data),
|
|
40
|
-
* ^? const data: string = "
|
|
40
|
+
* ^? const data: string = "Never gonna give you up, never gonna let you down..."
|
|
41
41
|
* }))
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
package/dist/react.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as SubscriptionReturns, t as SubscriptionOptions } from "./types-
|
|
1
|
+
import { n as SubscriptionReturns, t as SubscriptionOptions } from "./types-CCJtD9mu.mjs";
|
|
2
2
|
//#region src/react.d.ts
|
|
3
3
|
declare function useSubscription<TData, TError>({ enabled, ...subscriptionOptions }: SubscriptionOptions<TData, TError> & {
|
|
4
4
|
enabled?: boolean;
|
|
@@ -5,7 +5,7 @@ import { Client } from "effect/unstable/httpapi/HttpApiClient";
|
|
|
5
5
|
import { HttpApiEndpoint } from "effect/unstable/httpapi/HttpApiEndpoint";
|
|
6
6
|
import { SseEventFromData, StreamSse } from "effect/unstable/httpapi/HttpApiSchema";
|
|
7
7
|
//#region src/types.d.ts
|
|
8
|
-
type TanstackQueryOptionsProxy<T> = T extends Client.Method<HttpApiEndpoint<infer _Key, infer Method, infer _Path, infer Params, infer Query, infer Payload, infer Headers, infer Success, infer Error>, infer _Error, infer _Requires> ? {
|
|
8
|
+
type TanstackQueryOptionsProxy<T> = T extends Client.Method<HttpApiEndpoint<infer _Key, infer Method, infer _Path, infer Params, infer Query, infer Payload, infer Headers, infer Success, infer Error, infer _Middleware>, infer _Error, infer _Requires> ? {
|
|
9
9
|
queryOptions: Method extends 'GET' ? <TQuery = DefinedInitialDataOptions<UnwrapCodec<Success>, UnwrapCodec<Error>>>(input: MakeOptionalInput<([Params] extends [never] ? {} : {
|
|
10
10
|
params: UnwrapCodec<Params>;
|
|
11
11
|
}) & ([Query] extends [never] ? {} : {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiesen/effect-tanstack-query",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Effortlessly bridge Effect HTTP API clients with TanStack Query. Enjoy end-to-end type safety, zero-boilerplate options, and built-in streaming support out of the box.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,6 +67,11 @@
|
|
|
67
67
|
"effect": ">=4.0.0-beta.100 || >=4.0.0",
|
|
68
68
|
"react": ">=19.2.8"
|
|
69
69
|
},
|
|
70
|
+
"peerDependenciesMeta": {
|
|
71
|
+
"react": {
|
|
72
|
+
"optional": true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
70
75
|
"packageManager": "bun@1.3.0",
|
|
71
76
|
"patchedDependencies": {
|
|
72
77
|
"tegami@1.2.7": "patches/tegami@1.2.7.patch"
|