@tiesen/effect-tanstack-query 0.0.14 → 0.0.15
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/dist/vue.d.mts +6 -0
- package/dist/vue.mjs +1 -0
- package/package.json +19 -5
package/dist/vue.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as SubscriptionReturns, t as SubscriptionOptions } from "./types-A-WfeH_j.mjs";
|
|
2
|
+
import { MaybeRefOrGetter } from "vue";
|
|
3
|
+
//#region src/vue.d.ts
|
|
4
|
+
declare function useSubscription<TData, TError>(optsInput: MaybeRefOrGetter<SubscriptionOptions<TData, TError>>): SubscriptionReturns<TData, TError>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { type SubscriptionOptions, type SubscriptionReturns, useSubscription };
|
package/dist/vue.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hashKey as e}from"@tanstack/query-core";import{onUnmounted as t,reactive as n,toValue as r,watch as i}from"vue";function a(a){let o=n({data:null,error:null,status:`idle`,reset:()=>{}}),s=null,c=()=>{s&&=(s(),null)},l=()=>{c();let e=r(a);if(!e.enabled){o.status=`idle`,o.data=null,o.error=null;return}o.status=`connecting`,o.data=null,o.error=null;let t=e.subscriptionFn({autoReconnect:e.autoReconnect,keepAlive:e.keepAlive,onStarted:()=>{r(a).onStarted?.(),o.status=`pending`,o.error=null},onData:e=>{r(a).onData?.(e),o.status=`pending`,o.data=e,o.error=null},onError:e=>{r(a).onError?.(e),o.status=`error`,o.error=e},onConnectionChange:e=>{switch(r(a).onConnectionChange?.(e),e.status){case`connecting`:o.status=`connecting`,o.error=e.error??null;break;case`pending`:break;case`idle`:o.status=`idle`,o.data=null,o.error=null}}});s=()=>t()};return o.reset=l,i(()=>{let t=r(a);return{enabled:t.enabled,key:t.subcriptionKey?e(t.subcriptionKey):void 0}},({enabled:e})=>{e?l():(c(),o.status=`idle`,o.data=null,o.error=null)},{immediate:!0}),t(()=>c()),o}export{a as useSubscription};
|
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.15",
|
|
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": [
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"./react": {
|
|
41
41
|
"types": "./dist/react.d.mts",
|
|
42
42
|
"default": "./dist/react.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./vue": {
|
|
45
|
+
"types": "./dist/vue.d.mts",
|
|
46
|
+
"default": "./dist/vue.mjs"
|
|
43
47
|
}
|
|
44
48
|
},
|
|
45
49
|
"publishConfig": {
|
|
@@ -56,19 +60,29 @@
|
|
|
56
60
|
},
|
|
57
61
|
"devDependencies": {
|
|
58
62
|
"@types/react": "^19.2.18",
|
|
63
|
+
"@types/vue": "^2.0.0",
|
|
59
64
|
"oxfmt": "^0.62.0",
|
|
60
65
|
"oxlint": "^1.77.0",
|
|
61
|
-
"tegami": "^1.3.
|
|
66
|
+
"tegami": "^1.3.3",
|
|
62
67
|
"tsdown": "^0.22.14",
|
|
63
68
|
"typescript": "^7.0.2"
|
|
64
69
|
},
|
|
65
70
|
"peerDependencies": {
|
|
66
71
|
"@tanstack/query-core": ">=5.100.0",
|
|
67
|
-
"effect": ">=4.0.0-beta.
|
|
68
|
-
"react": ">=19.2.8"
|
|
72
|
+
"effect": ">=4.0.0-beta.105",
|
|
73
|
+
"react": ">=19.2.8",
|
|
74
|
+
"vue": ">=3.5.40"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"react": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"vue": {
|
|
81
|
+
"optional": true
|
|
82
|
+
}
|
|
69
83
|
},
|
|
70
84
|
"packageManager": "bun@1.3.0",
|
|
71
85
|
"patchedDependencies": {
|
|
72
|
-
"tegami@1.3.
|
|
86
|
+
"tegami@1.3.3": "patches/tegami@1.3.3.patch"
|
|
73
87
|
}
|
|
74
88
|
}
|