@effector-tanstack-query/core 0.1.0
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 +40 -0
- package/dist/createBaseQuery.cjs +208 -0
- package/dist/createBaseQuery.cjs.map +1 -0
- package/dist/createBaseQuery.d.cts +114 -0
- package/dist/createBaseQuery.d.ts +114 -0
- package/dist/createBaseQuery.js +204 -0
- package/dist/createBaseQuery.js.map +1 -0
- package/dist/createInfiniteQuery.cjs +193 -0
- package/dist/createInfiniteQuery.cjs.map +1 -0
- package/dist/createInfiniteQuery.d.cts +8 -0
- package/dist/createInfiniteQuery.d.ts +8 -0
- package/dist/createInfiniteQuery.js +191 -0
- package/dist/createInfiniteQuery.js.map +1 -0
- package/dist/createInvalidate.cjs +37 -0
- package/dist/createInvalidate.cjs.map +1 -0
- package/dist/createInvalidate.d.cts +50 -0
- package/dist/createInvalidate.d.ts +50 -0
- package/dist/createInvalidate.js +35 -0
- package/dist/createInvalidate.js.map +1 -0
- package/dist/createMutation.cjs +177 -0
- package/dist/createMutation.cjs.map +1 -0
- package/dist/createMutation.d.cts +7 -0
- package/dist/createMutation.d.ts +7 -0
- package/dist/createMutation.js +175 -0
- package/dist/createMutation.js.map +1 -0
- package/dist/createQuery.cjs +98 -0
- package/dist/createQuery.cjs.map +1 -0
- package/dist/createQuery.d.cts +8 -0
- package/dist/createQuery.d.ts +8 -0
- package/dist/createQuery.js +96 -0
- package/dist/createQuery.js.map +1 -0
- package/dist/index.cjs +36 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/queryClient.cjs +20 -0
- package/dist/queryClient.cjs.map +1 -0
- package/dist/queryClient.d.cts +15 -0
- package/dist/queryClient.d.ts +15 -0
- package/dist/queryClient.js +17 -0
- package/dist/queryClient.js.map +1 -0
- package/dist/resolve.cjs +37 -0
- package/dist/resolve.cjs.map +1 -0
- package/dist/resolve.d.cts +17 -0
- package/dist/resolve.d.ts +17 -0
- package/dist/resolve.js +33 -0
- package/dist/resolve.js.map +1 -0
- package/dist/types.cjs +4 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +209 -0
- package/dist/types.d.ts +209 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +60 -0
- package/src/createBaseQuery.ts +428 -0
- package/src/createInfiniteQuery.ts +291 -0
- package/src/createInvalidate.ts +104 -0
- package/src/createMutation.ts +271 -0
- package/src/createQuery.ts +155 -0
- package/src/index.ts +17 -0
- package/src/queryClient.ts +23 -0
- package/src/resolve.ts +50 -0
- package/src/types.ts +270 -0
package/dist/resolve.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var effector = require('effector');
|
|
4
|
+
|
|
5
|
+
// src/resolve.ts
|
|
6
|
+
function resolveKey(key) {
|
|
7
|
+
const storePositions = [];
|
|
8
|
+
const stores = [];
|
|
9
|
+
key.forEach((item, i) => {
|
|
10
|
+
if (effector.is.store(item)) {
|
|
11
|
+
storePositions.push(i);
|
|
12
|
+
stores.push(item);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
if (stores.length === 0) {
|
|
16
|
+
return effector.createStore(key);
|
|
17
|
+
}
|
|
18
|
+
return effector.combine(stores).map(
|
|
19
|
+
(values) => key.map((item, i) => {
|
|
20
|
+
const storeIdx = storePositions.indexOf(i);
|
|
21
|
+
return storeIdx >= 0 ? values[storeIdx] : item;
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function resolveEnabled(enabled) {
|
|
26
|
+
if (effector.is.store(enabled)) return enabled;
|
|
27
|
+
return effector.createStore(enabled ?? true);
|
|
28
|
+
}
|
|
29
|
+
function resolveReactiveRefetchInterval(value) {
|
|
30
|
+
return effector.is.store(value) ? value : void 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.resolveEnabled = resolveEnabled;
|
|
34
|
+
exports.resolveKey = resolveKey;
|
|
35
|
+
exports.resolveReactiveRefetchInterval = resolveReactiveRefetchInterval;
|
|
36
|
+
//# sourceMappingURL=resolve.cjs.map
|
|
37
|
+
//# sourceMappingURL=resolve.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resolve.ts"],"names":["is","createStore","combine"],"mappings":";;;;;AAKO,SAAS,WAAW,GAAA,EAAwC;AACjE,EAAA,MAAM,iBAAgC,EAAC;AACvC,EAAA,MAAM,SAAgC,EAAC;AAEvC,EAAA,GAAA,CAAI,OAAA,CAAQ,CAAC,IAAA,EAAM,CAAA,KAAM;AACvB,IAAA,IAAIA,WAAA,CAAG,KAAA,CAAM,IAAI,CAAA,EAAG;AAClB,MAAA,cAAA,CAAe,KAAK,CAAC,CAAA;AACrB,MAAA,MAAA,CAAO,KAAK,IAAsB,CAAA;AAAA,IACpC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG;AACvB,IAAA,OAAOC,qBAAY,GAAe,CAAA;AAAA,EACpC;AAEA,EAAA,OAAOC,gBAAA,CAAQ,MAAM,CAAA,CAAE,GAAA;AAAA,IAAI,CAAC,MAAA,KAC1B,GAAA,CAAI,GAAA,CAAI,CAAC,MAAM,CAAA,KAAM;AACnB,MAAA,MAAM,QAAA,GAAW,cAAA,CAAe,OAAA,CAAQ,CAAC,CAAA;AACzC,MAAA,OAAO,QAAA,IAAY,CAAA,GAAI,MAAA,CAAO,QAAQ,CAAA,GAAI,IAAA;AAAA,IAC5C,CAAC;AAAA,GACH;AACF;AAEO,SAAS,eACd,OAAA,EACgB;AAChB,EAAA,IAAIF,WAAA,CAAG,KAAA,CAAM,OAAO,CAAA,EAAG,OAAO,OAAA;AAC9B,EAAA,OAAOC,oBAAA,CAAY,WAAW,IAAI,CAAA;AACpC;AAUO,SAAS,+BACd,KAAA,EAC+C;AAC/C,EAAA,OAAOD,WAAA,CAAG,KAAA,CAAM,KAAK,CAAA,GAChB,KAAA,GACD,MAAA;AACN","file":"resolve.cjs","sourcesContent":["import { combine, createStore, is } from 'effector'\nimport type { Store } from 'effector'\nimport type { QueryKey } from '@tanstack/query-core'\nimport type { EffectorQueryKey, StoreOrValue } from './types'\n\nexport function resolveKey(key: EffectorQueryKey): Store<QueryKey> {\n const storePositions: Array<number> = []\n const stores: Array<Store<unknown>> = []\n\n key.forEach((item, i) => {\n if (is.store(item)) {\n storePositions.push(i)\n stores.push(item as Store<unknown>)\n }\n })\n\n if (stores.length === 0) {\n return createStore(key as QueryKey)\n }\n\n return combine(stores).map((values) =>\n key.map((item, i) => {\n const storeIdx = storePositions.indexOf(i)\n return storeIdx >= 0 ? values[storeIdx] : item\n }),\n ) as Store<QueryKey>\n}\n\nexport function resolveEnabled(\n enabled: StoreOrValue<boolean> | undefined,\n): Store<boolean> {\n if (is.store(enabled)) return enabled\n return createStore(enabled ?? true)\n}\n\n/**\n * `refetchInterval` accepts a static value, a function `(query) => …`, or an\n * effector `Store<number | false>`. Only the Store form is \"reactive\" — the\n * function form is evaluated by the observer on every tick and stays in the\n * observer's options. Returns the store if one was passed, `undefined`\n * otherwise (signaling the per-flavor factory to keep the value in\n * `restOptions` for the observer constructor).\n */\nexport function resolveReactiveRefetchInterval(\n value: unknown,\n): Store<number | false | undefined> | undefined {\n return is.store(value)\n ? (value as Store<number | false | undefined>)\n : undefined\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Store } from 'effector';
|
|
2
|
+
import { QueryKey } from '@tanstack/query-core';
|
|
3
|
+
import { StoreOrValue, EffectorQueryKey } from './types.cjs';
|
|
4
|
+
|
|
5
|
+
declare function resolveKey(key: EffectorQueryKey): Store<QueryKey>;
|
|
6
|
+
declare function resolveEnabled(enabled: StoreOrValue<boolean> | undefined): Store<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* `refetchInterval` accepts a static value, a function `(query) => …`, or an
|
|
9
|
+
* effector `Store<number | false>`. Only the Store form is "reactive" — the
|
|
10
|
+
* function form is evaluated by the observer on every tick and stays in the
|
|
11
|
+
* observer's options. Returns the store if one was passed, `undefined`
|
|
12
|
+
* otherwise (signaling the per-flavor factory to keep the value in
|
|
13
|
+
* `restOptions` for the observer constructor).
|
|
14
|
+
*/
|
|
15
|
+
declare function resolveReactiveRefetchInterval(value: unknown): Store<number | false | undefined> | undefined;
|
|
16
|
+
|
|
17
|
+
export { resolveEnabled, resolveKey, resolveReactiveRefetchInterval };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Store } from 'effector';
|
|
2
|
+
import { QueryKey } from '@tanstack/query-core';
|
|
3
|
+
import { StoreOrValue, EffectorQueryKey } from './types.js';
|
|
4
|
+
|
|
5
|
+
declare function resolveKey(key: EffectorQueryKey): Store<QueryKey>;
|
|
6
|
+
declare function resolveEnabled(enabled: StoreOrValue<boolean> | undefined): Store<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* `refetchInterval` accepts a static value, a function `(query) => …`, or an
|
|
9
|
+
* effector `Store<number | false>`. Only the Store form is "reactive" — the
|
|
10
|
+
* function form is evaluated by the observer on every tick and stays in the
|
|
11
|
+
* observer's options. Returns the store if one was passed, `undefined`
|
|
12
|
+
* otherwise (signaling the per-flavor factory to keep the value in
|
|
13
|
+
* `restOptions` for the observer constructor).
|
|
14
|
+
*/
|
|
15
|
+
declare function resolveReactiveRefetchInterval(value: unknown): Store<number | false | undefined> | undefined;
|
|
16
|
+
|
|
17
|
+
export { resolveEnabled, resolveKey, resolveReactiveRefetchInterval };
|
package/dist/resolve.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { is, createStore, combine } from 'effector';
|
|
2
|
+
|
|
3
|
+
// src/resolve.ts
|
|
4
|
+
function resolveKey(key) {
|
|
5
|
+
const storePositions = [];
|
|
6
|
+
const stores = [];
|
|
7
|
+
key.forEach((item, i) => {
|
|
8
|
+
if (is.store(item)) {
|
|
9
|
+
storePositions.push(i);
|
|
10
|
+
stores.push(item);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
if (stores.length === 0) {
|
|
14
|
+
return createStore(key);
|
|
15
|
+
}
|
|
16
|
+
return combine(stores).map(
|
|
17
|
+
(values) => key.map((item, i) => {
|
|
18
|
+
const storeIdx = storePositions.indexOf(i);
|
|
19
|
+
return storeIdx >= 0 ? values[storeIdx] : item;
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function resolveEnabled(enabled) {
|
|
24
|
+
if (is.store(enabled)) return enabled;
|
|
25
|
+
return createStore(enabled ?? true);
|
|
26
|
+
}
|
|
27
|
+
function resolveReactiveRefetchInterval(value) {
|
|
28
|
+
return is.store(value) ? value : void 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { resolveEnabled, resolveKey, resolveReactiveRefetchInterval };
|
|
32
|
+
//# sourceMappingURL=resolve.js.map
|
|
33
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resolve.ts"],"names":[],"mappings":";;;AAKO,SAAS,WAAW,GAAA,EAAwC;AACjE,EAAA,MAAM,iBAAgC,EAAC;AACvC,EAAA,MAAM,SAAgC,EAAC;AAEvC,EAAA,GAAA,CAAI,OAAA,CAAQ,CAAC,IAAA,EAAM,CAAA,KAAM;AACvB,IAAA,IAAI,EAAA,CAAG,KAAA,CAAM,IAAI,CAAA,EAAG;AAClB,MAAA,cAAA,CAAe,KAAK,CAAC,CAAA;AACrB,MAAA,MAAA,CAAO,KAAK,IAAsB,CAAA;AAAA,IACpC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,IAAI,MAAA,CAAO,WAAW,CAAA,EAAG;AACvB,IAAA,OAAO,YAAY,GAAe,CAAA;AAAA,EACpC;AAEA,EAAA,OAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,GAAA;AAAA,IAAI,CAAC,MAAA,KAC1B,GAAA,CAAI,GAAA,CAAI,CAAC,MAAM,CAAA,KAAM;AACnB,MAAA,MAAM,QAAA,GAAW,cAAA,CAAe,OAAA,CAAQ,CAAC,CAAA;AACzC,MAAA,OAAO,QAAA,IAAY,CAAA,GAAI,MAAA,CAAO,QAAQ,CAAA,GAAI,IAAA;AAAA,IAC5C,CAAC;AAAA,GACH;AACF;AAEO,SAAS,eACd,OAAA,EACgB;AAChB,EAAA,IAAI,EAAA,CAAG,KAAA,CAAM,OAAO,CAAA,EAAG,OAAO,OAAA;AAC9B,EAAA,OAAO,WAAA,CAAY,WAAW,IAAI,CAAA;AACpC;AAUO,SAAS,+BACd,KAAA,EAC+C;AAC/C,EAAA,OAAO,EAAA,CAAG,KAAA,CAAM,KAAK,CAAA,GAChB,KAAA,GACD,MAAA;AACN","file":"resolve.js","sourcesContent":["import { combine, createStore, is } from 'effector'\nimport type { Store } from 'effector'\nimport type { QueryKey } from '@tanstack/query-core'\nimport type { EffectorQueryKey, StoreOrValue } from './types'\n\nexport function resolveKey(key: EffectorQueryKey): Store<QueryKey> {\n const storePositions: Array<number> = []\n const stores: Array<Store<unknown>> = []\n\n key.forEach((item, i) => {\n if (is.store(item)) {\n storePositions.push(i)\n stores.push(item as Store<unknown>)\n }\n })\n\n if (stores.length === 0) {\n return createStore(key as QueryKey)\n }\n\n return combine(stores).map((values) =>\n key.map((item, i) => {\n const storeIdx = storePositions.indexOf(i)\n return storeIdx >= 0 ? values[storeIdx] : item\n }),\n ) as Store<QueryKey>\n}\n\nexport function resolveEnabled(\n enabled: StoreOrValue<boolean> | undefined,\n): Store<boolean> {\n if (is.store(enabled)) return enabled\n return createStore(enabled ?? true)\n}\n\n/**\n * `refetchInterval` accepts a static value, a function `(query) => …`, or an\n * effector `Store<number | false>`. Only the Store form is \"reactive\" — the\n * function form is evaluated by the observer on every tick and stays in the\n * observer's options. Returns the store if one was passed, `undefined`\n * otherwise (signaling the per-flavor factory to keep the value in\n * `restOptions` for the observer constructor).\n */\nexport function resolveReactiveRefetchInterval(\n value: unknown,\n): Store<number | false | undefined> | undefined {\n return is.store(value)\n ? (value as Store<number | false | undefined>)\n : undefined\n}\n"]}
|
package/dist/types.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.cjs"}
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Store, EventCallable, Event } from 'effector';
|
|
2
|
+
import { InfiniteData, InfiniteQueryObserverOptions, QueryStatus, FetchStatus, InfiniteQueryObserver, QueryKey, QueryClient, MutationObserverOptions, MutationObserver, MutateOptions, QueryObserverOptions, QueryObserver } from '@tanstack/query-core';
|
|
3
|
+
|
|
4
|
+
type StoreOrValue<T> = Store<T> | T;
|
|
5
|
+
/**
|
|
6
|
+
* A query key where each element can be a plain value or an effector Store.
|
|
7
|
+
* When any Store changes, the query is automatically re-executed with the new key.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const $userId = createStore(1)
|
|
11
|
+
* queryKey: ['user', $userId, 'details']
|
|
12
|
+
*/
|
|
13
|
+
type EffectorQueryKey = ReadonlyArray<StoreOrValue<string | number | bigint | boolean | null | undefined | object>>;
|
|
14
|
+
interface CreateQueryOptions<TQueryFnData = unknown, TError = Error, TData = TQueryFnData> extends Omit<QueryObserverOptions<TQueryFnData, TError, TData>, 'queryKey' | 'enabled' | 'refetchInterval'> {
|
|
15
|
+
queryKey: EffectorQueryKey;
|
|
16
|
+
enabled?: StoreOrValue<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Polling interval in milliseconds, `false` to disable, or a Store for
|
|
19
|
+
* runtime toggling — `Store<number | false>`. When a Store is passed, the
|
|
20
|
+
* observer's `refetchInterval` is automatically kept in sync via
|
|
21
|
+
* `setOptions` on every store change. The function form (`(query) => …`)
|
|
22
|
+
* from TanStack Query is also still supported.
|
|
23
|
+
*/
|
|
24
|
+
refetchInterval?: QueryObserverOptions<TQueryFnData, TError, TData>['refetchInterval'] | Store<number | false | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Stable name used to derive SIDs for the internal effector stores so that
|
|
27
|
+
* `serialize(scope)` / `fork({ values })` round-trip works for SSR. Without
|
|
28
|
+
* a name, the queryClient's `dehydrate`/`hydrate` path still works, but
|
|
29
|
+
* scope-only serialization will silently drop these stores.
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
}
|
|
33
|
+
interface QueryResult<TData, TError = Error> {
|
|
34
|
+
/** The resolved query data, or `undefined` while loading */
|
|
35
|
+
$data: Store<TData | undefined>;
|
|
36
|
+
/** The query error, or `null` if there is none */
|
|
37
|
+
$error: Store<TError | null>;
|
|
38
|
+
/** The query status: `'pending'` | `'success'` | `'error'` */
|
|
39
|
+
$status: Store<QueryStatus>;
|
|
40
|
+
/** `true` while there is no cached data and the query is fetching */
|
|
41
|
+
$isPending: Store<boolean>;
|
|
42
|
+
/** `true` while the query is fetching in the background */
|
|
43
|
+
$isFetching: Store<boolean>;
|
|
44
|
+
/** `true` when the query has successfully fetched data */
|
|
45
|
+
$isSuccess: Store<boolean>;
|
|
46
|
+
/** `true` when the query has failed */
|
|
47
|
+
$isError: Store<boolean>;
|
|
48
|
+
/** `true` when the displayed data is placeholder data (not yet fetched for current key) */
|
|
49
|
+
$isPlaceholderData: Store<boolean>;
|
|
50
|
+
/** The fetch status: `'fetching'` | `'paused'` | `'idle'` */
|
|
51
|
+
$fetchStatus: Store<FetchStatus>;
|
|
52
|
+
/** Invalidates the query and triggers a background refetch */
|
|
53
|
+
refresh: EventCallable<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetches the query via `queryClient.fetchQuery` and **awaits** the result.
|
|
56
|
+
* Unlike `mounted`, this is meant for server-side prefetching / route
|
|
57
|
+
* loaders where you need the cache populated before responding to the
|
|
58
|
+
* request — `await allSettled(query.prefetch, { scope })` returns only
|
|
59
|
+
* after the queryFn has resolved. Skips automatically when `enabled` is
|
|
60
|
+
* `false`.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await allSettled(query.prefetch, { scope })
|
|
64
|
+
* // queryClient cache + scope are now ready to be dehydrated/serialized.
|
|
65
|
+
*/
|
|
66
|
+
prefetch: EventCallable<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Initializes the query subscription. Must be called (or used with allSettled)
|
|
69
|
+
* before the query starts fetching.
|
|
70
|
+
*
|
|
71
|
+
* @example Without fork
|
|
72
|
+
* query.mounted()
|
|
73
|
+
*
|
|
74
|
+
* @example With fork (test isolation)
|
|
75
|
+
* const scope = fork()
|
|
76
|
+
* await allSettled(query.mounted, { scope })
|
|
77
|
+
*/
|
|
78
|
+
mounted: EventCallable<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Tears down the query subscription and cancels any in-flight request.
|
|
81
|
+
* Call this when the consumer is destroyed (e.g. component unmount).
|
|
82
|
+
*/
|
|
83
|
+
unmounted: EventCallable<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Per-scope observer store. Each fork scope has its own Observer instance,
|
|
86
|
+
* created lazily on `mounted()` and bound to that scope's QueryClient.
|
|
87
|
+
* Read scope-aware via `useUnit($observer)`. For tests, prefer
|
|
88
|
+
* `scope.getState($observer)` over reading the default scope state.
|
|
89
|
+
*/
|
|
90
|
+
$observer: Store<QueryObserver<TData, TError> | null>;
|
|
91
|
+
/**
|
|
92
|
+
* The QueryClient store this query is bound to. Frozen if a client was
|
|
93
|
+
* passed explicitly to the factory; otherwise points at the global
|
|
94
|
+
* `$queryClient` and honors `fork({ values: [[$queryClient, qc]] })`.
|
|
95
|
+
*/
|
|
96
|
+
$queryClient: Store<QueryClient | null>;
|
|
97
|
+
}
|
|
98
|
+
interface CreateInfiniteQueryOptions<TQueryFnData = unknown, TError = Error, TPageParam = unknown, TData = InfiniteData<TQueryFnData, TPageParam>> extends Omit<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, ReadonlyArray<unknown>, TPageParam>, 'queryKey' | 'enabled' | 'refetchInterval'> {
|
|
99
|
+
queryKey: EffectorQueryKey;
|
|
100
|
+
enabled?: StoreOrValue<boolean>;
|
|
101
|
+
/** See {@link CreateQueryOptions.refetchInterval}. */
|
|
102
|
+
refetchInterval?: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, ReadonlyArray<unknown>, TPageParam>['refetchInterval'] | Store<number | false | undefined>;
|
|
103
|
+
/** See {@link CreateQueryOptions.name}. */
|
|
104
|
+
name?: string;
|
|
105
|
+
}
|
|
106
|
+
interface InfiniteQueryResult<TData, TError = Error, TPageParam = unknown> {
|
|
107
|
+
/**
|
|
108
|
+
* The selected/displayed data. Defaults to `InfiniteData<TQueryFnData, TPageParam>`
|
|
109
|
+
* but narrows to whatever `select` returns when provided.
|
|
110
|
+
*/
|
|
111
|
+
$data: Store<TData | undefined>;
|
|
112
|
+
$error: Store<TError | null>;
|
|
113
|
+
$status: Store<QueryStatus>;
|
|
114
|
+
$isPending: Store<boolean>;
|
|
115
|
+
$isFetching: Store<boolean>;
|
|
116
|
+
$isSuccess: Store<boolean>;
|
|
117
|
+
$isError: Store<boolean>;
|
|
118
|
+
$isPlaceholderData: Store<boolean>;
|
|
119
|
+
$fetchStatus: Store<FetchStatus>;
|
|
120
|
+
$hasNextPage: Store<boolean>;
|
|
121
|
+
$hasPreviousPage: Store<boolean>;
|
|
122
|
+
$isFetchingNextPage: Store<boolean>;
|
|
123
|
+
$isFetchingPreviousPage: Store<boolean>;
|
|
124
|
+
$isFetchNextPageError: Store<boolean>;
|
|
125
|
+
$isFetchPreviousPageError: Store<boolean>;
|
|
126
|
+
fetchNextPage: EventCallable<void>;
|
|
127
|
+
fetchPreviousPage: EventCallable<void>;
|
|
128
|
+
refresh: EventCallable<void>;
|
|
129
|
+
/** See {@link QueryResult.prefetch}. Uses `fetchInfiniteQuery` under the hood. */
|
|
130
|
+
prefetch: EventCallable<void>;
|
|
131
|
+
mounted: EventCallable<void>;
|
|
132
|
+
unmounted: EventCallable<void>;
|
|
133
|
+
/** See {@link QueryResult.$observer}. */
|
|
134
|
+
$observer: Store<InfiniteQueryObserver<any, TError, TData, QueryKey, TPageParam> | null>;
|
|
135
|
+
/** See {@link QueryResult.$queryClient}. */
|
|
136
|
+
$queryClient: Store<QueryClient | null>;
|
|
137
|
+
}
|
|
138
|
+
type CreateMutationOptions<TData = unknown, TError = Error, TVariables = void, TOnMutateResult = unknown> = MutationObserverOptions<TData, TError, TVariables, TOnMutateResult> & {
|
|
139
|
+
/** See {@link CreateQueryOptions.name}. */
|
|
140
|
+
name?: string;
|
|
141
|
+
};
|
|
142
|
+
type MutationStatus = 'idle' | 'pending' | 'success' | 'error';
|
|
143
|
+
interface MutationResult<TData = unknown, TError = Error, TVariables = void> {
|
|
144
|
+
/** The mutation result data, or `undefined` before success */
|
|
145
|
+
$data: Store<TData | undefined>;
|
|
146
|
+
/** The mutation error, or `null` if there is none */
|
|
147
|
+
$error: Store<TError | null>;
|
|
148
|
+
/** The mutation status: `'idle'` | `'pending'` | `'success'` | `'error'` */
|
|
149
|
+
$status: Store<MutationStatus>;
|
|
150
|
+
/** The variables passed to the last `mutate` call */
|
|
151
|
+
$variables: Store<TVariables | undefined>;
|
|
152
|
+
/** `true` while the mutation is paused (e.g. offline) and cannot run */
|
|
153
|
+
$isPaused: Store<boolean>;
|
|
154
|
+
/** `true` while the mutation is executing */
|
|
155
|
+
$isPending: Store<boolean>;
|
|
156
|
+
/** `true` when the mutation has succeeded */
|
|
157
|
+
$isSuccess: Store<boolean>;
|
|
158
|
+
/** `true` when the mutation has failed */
|
|
159
|
+
$isError: Store<boolean>;
|
|
160
|
+
/** `true` when the mutation has not yet been triggered */
|
|
161
|
+
$isIdle: Store<boolean>;
|
|
162
|
+
/** Per-scope MutationObserver. Created on `start()`. See {@link QueryResult.$observer}. */
|
|
163
|
+
$observer: Store<MutationObserver<TData, TError, TVariables, any> | null>;
|
|
164
|
+
/** See {@link QueryResult.$queryClient}. */
|
|
165
|
+
$queryClient: Store<QueryClient | null>;
|
|
166
|
+
/** Triggers the mutation with the given variables */
|
|
167
|
+
mutate: EventCallable<TVariables>;
|
|
168
|
+
/**
|
|
169
|
+
* Triggers the mutation with per-call callbacks layered on top of the
|
|
170
|
+
* observer-level ones. Use when you need component-local reactions
|
|
171
|
+
* (e.g. navigate after success) without module-level `sample` wiring.
|
|
172
|
+
*/
|
|
173
|
+
mutateWith: EventCallable<{
|
|
174
|
+
variables: TVariables;
|
|
175
|
+
onSuccess?: MutateOptions<TData, TError, TVariables>['onSuccess'];
|
|
176
|
+
onError?: MutateOptions<TData, TError, TVariables>['onError'];
|
|
177
|
+
onSettled?: MutateOptions<TData, TError, TVariables>['onSettled'];
|
|
178
|
+
}>;
|
|
179
|
+
/** Resets the mutation state back to idle */
|
|
180
|
+
reset: EventCallable<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Initializes the mutation observer subscription.
|
|
183
|
+
* Must be called before mutate to ensure stores receive updates.
|
|
184
|
+
*/
|
|
185
|
+
start: EventCallable<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Tears down the observer subscription. Call this when the consumer is
|
|
188
|
+
* destroyed (e.g. component unmount) so the queryClient can gc the
|
|
189
|
+
* mutation entry.
|
|
190
|
+
*/
|
|
191
|
+
unmounted: EventCallable<void>;
|
|
192
|
+
/**
|
|
193
|
+
* Sample-friendly events for module-level reactions to mutation outcome.
|
|
194
|
+
* Payloads include both the original `params` and the `result` / `error`,
|
|
195
|
+
* matching effector effect `done` / `fail` shape.
|
|
196
|
+
*/
|
|
197
|
+
finished: {
|
|
198
|
+
success: Event<{
|
|
199
|
+
params: TVariables;
|
|
200
|
+
result: TData;
|
|
201
|
+
}>;
|
|
202
|
+
failure: Event<{
|
|
203
|
+
params: TVariables;
|
|
204
|
+
error: TError;
|
|
205
|
+
}>;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type { CreateInfiniteQueryOptions, CreateMutationOptions, CreateQueryOptions, EffectorQueryKey, InfiniteQueryResult, MutationResult, MutationStatus, QueryResult, StoreOrValue };
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Store, EventCallable, Event } from 'effector';
|
|
2
|
+
import { InfiniteData, InfiniteQueryObserverOptions, QueryStatus, FetchStatus, InfiniteQueryObserver, QueryKey, QueryClient, MutationObserverOptions, MutationObserver, MutateOptions, QueryObserverOptions, QueryObserver } from '@tanstack/query-core';
|
|
3
|
+
|
|
4
|
+
type StoreOrValue<T> = Store<T> | T;
|
|
5
|
+
/**
|
|
6
|
+
* A query key where each element can be a plain value or an effector Store.
|
|
7
|
+
* When any Store changes, the query is automatically re-executed with the new key.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const $userId = createStore(1)
|
|
11
|
+
* queryKey: ['user', $userId, 'details']
|
|
12
|
+
*/
|
|
13
|
+
type EffectorQueryKey = ReadonlyArray<StoreOrValue<string | number | bigint | boolean | null | undefined | object>>;
|
|
14
|
+
interface CreateQueryOptions<TQueryFnData = unknown, TError = Error, TData = TQueryFnData> extends Omit<QueryObserverOptions<TQueryFnData, TError, TData>, 'queryKey' | 'enabled' | 'refetchInterval'> {
|
|
15
|
+
queryKey: EffectorQueryKey;
|
|
16
|
+
enabled?: StoreOrValue<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Polling interval in milliseconds, `false` to disable, or a Store for
|
|
19
|
+
* runtime toggling — `Store<number | false>`. When a Store is passed, the
|
|
20
|
+
* observer's `refetchInterval` is automatically kept in sync via
|
|
21
|
+
* `setOptions` on every store change. The function form (`(query) => …`)
|
|
22
|
+
* from TanStack Query is also still supported.
|
|
23
|
+
*/
|
|
24
|
+
refetchInterval?: QueryObserverOptions<TQueryFnData, TError, TData>['refetchInterval'] | Store<number | false | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Stable name used to derive SIDs for the internal effector stores so that
|
|
27
|
+
* `serialize(scope)` / `fork({ values })` round-trip works for SSR. Without
|
|
28
|
+
* a name, the queryClient's `dehydrate`/`hydrate` path still works, but
|
|
29
|
+
* scope-only serialization will silently drop these stores.
|
|
30
|
+
*/
|
|
31
|
+
name?: string;
|
|
32
|
+
}
|
|
33
|
+
interface QueryResult<TData, TError = Error> {
|
|
34
|
+
/** The resolved query data, or `undefined` while loading */
|
|
35
|
+
$data: Store<TData | undefined>;
|
|
36
|
+
/** The query error, or `null` if there is none */
|
|
37
|
+
$error: Store<TError | null>;
|
|
38
|
+
/** The query status: `'pending'` | `'success'` | `'error'` */
|
|
39
|
+
$status: Store<QueryStatus>;
|
|
40
|
+
/** `true` while there is no cached data and the query is fetching */
|
|
41
|
+
$isPending: Store<boolean>;
|
|
42
|
+
/** `true` while the query is fetching in the background */
|
|
43
|
+
$isFetching: Store<boolean>;
|
|
44
|
+
/** `true` when the query has successfully fetched data */
|
|
45
|
+
$isSuccess: Store<boolean>;
|
|
46
|
+
/** `true` when the query has failed */
|
|
47
|
+
$isError: Store<boolean>;
|
|
48
|
+
/** `true` when the displayed data is placeholder data (not yet fetched for current key) */
|
|
49
|
+
$isPlaceholderData: Store<boolean>;
|
|
50
|
+
/** The fetch status: `'fetching'` | `'paused'` | `'idle'` */
|
|
51
|
+
$fetchStatus: Store<FetchStatus>;
|
|
52
|
+
/** Invalidates the query and triggers a background refetch */
|
|
53
|
+
refresh: EventCallable<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Fetches the query via `queryClient.fetchQuery` and **awaits** the result.
|
|
56
|
+
* Unlike `mounted`, this is meant for server-side prefetching / route
|
|
57
|
+
* loaders where you need the cache populated before responding to the
|
|
58
|
+
* request — `await allSettled(query.prefetch, { scope })` returns only
|
|
59
|
+
* after the queryFn has resolved. Skips automatically when `enabled` is
|
|
60
|
+
* `false`.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await allSettled(query.prefetch, { scope })
|
|
64
|
+
* // queryClient cache + scope are now ready to be dehydrated/serialized.
|
|
65
|
+
*/
|
|
66
|
+
prefetch: EventCallable<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Initializes the query subscription. Must be called (or used with allSettled)
|
|
69
|
+
* before the query starts fetching.
|
|
70
|
+
*
|
|
71
|
+
* @example Without fork
|
|
72
|
+
* query.mounted()
|
|
73
|
+
*
|
|
74
|
+
* @example With fork (test isolation)
|
|
75
|
+
* const scope = fork()
|
|
76
|
+
* await allSettled(query.mounted, { scope })
|
|
77
|
+
*/
|
|
78
|
+
mounted: EventCallable<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Tears down the query subscription and cancels any in-flight request.
|
|
81
|
+
* Call this when the consumer is destroyed (e.g. component unmount).
|
|
82
|
+
*/
|
|
83
|
+
unmounted: EventCallable<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Per-scope observer store. Each fork scope has its own Observer instance,
|
|
86
|
+
* created lazily on `mounted()` and bound to that scope's QueryClient.
|
|
87
|
+
* Read scope-aware via `useUnit($observer)`. For tests, prefer
|
|
88
|
+
* `scope.getState($observer)` over reading the default scope state.
|
|
89
|
+
*/
|
|
90
|
+
$observer: Store<QueryObserver<TData, TError> | null>;
|
|
91
|
+
/**
|
|
92
|
+
* The QueryClient store this query is bound to. Frozen if a client was
|
|
93
|
+
* passed explicitly to the factory; otherwise points at the global
|
|
94
|
+
* `$queryClient` and honors `fork({ values: [[$queryClient, qc]] })`.
|
|
95
|
+
*/
|
|
96
|
+
$queryClient: Store<QueryClient | null>;
|
|
97
|
+
}
|
|
98
|
+
interface CreateInfiniteQueryOptions<TQueryFnData = unknown, TError = Error, TPageParam = unknown, TData = InfiniteData<TQueryFnData, TPageParam>> extends Omit<InfiniteQueryObserverOptions<TQueryFnData, TError, TData, ReadonlyArray<unknown>, TPageParam>, 'queryKey' | 'enabled' | 'refetchInterval'> {
|
|
99
|
+
queryKey: EffectorQueryKey;
|
|
100
|
+
enabled?: StoreOrValue<boolean>;
|
|
101
|
+
/** See {@link CreateQueryOptions.refetchInterval}. */
|
|
102
|
+
refetchInterval?: InfiniteQueryObserverOptions<TQueryFnData, TError, TData, ReadonlyArray<unknown>, TPageParam>['refetchInterval'] | Store<number | false | undefined>;
|
|
103
|
+
/** See {@link CreateQueryOptions.name}. */
|
|
104
|
+
name?: string;
|
|
105
|
+
}
|
|
106
|
+
interface InfiniteQueryResult<TData, TError = Error, TPageParam = unknown> {
|
|
107
|
+
/**
|
|
108
|
+
* The selected/displayed data. Defaults to `InfiniteData<TQueryFnData, TPageParam>`
|
|
109
|
+
* but narrows to whatever `select` returns when provided.
|
|
110
|
+
*/
|
|
111
|
+
$data: Store<TData | undefined>;
|
|
112
|
+
$error: Store<TError | null>;
|
|
113
|
+
$status: Store<QueryStatus>;
|
|
114
|
+
$isPending: Store<boolean>;
|
|
115
|
+
$isFetching: Store<boolean>;
|
|
116
|
+
$isSuccess: Store<boolean>;
|
|
117
|
+
$isError: Store<boolean>;
|
|
118
|
+
$isPlaceholderData: Store<boolean>;
|
|
119
|
+
$fetchStatus: Store<FetchStatus>;
|
|
120
|
+
$hasNextPage: Store<boolean>;
|
|
121
|
+
$hasPreviousPage: Store<boolean>;
|
|
122
|
+
$isFetchingNextPage: Store<boolean>;
|
|
123
|
+
$isFetchingPreviousPage: Store<boolean>;
|
|
124
|
+
$isFetchNextPageError: Store<boolean>;
|
|
125
|
+
$isFetchPreviousPageError: Store<boolean>;
|
|
126
|
+
fetchNextPage: EventCallable<void>;
|
|
127
|
+
fetchPreviousPage: EventCallable<void>;
|
|
128
|
+
refresh: EventCallable<void>;
|
|
129
|
+
/** See {@link QueryResult.prefetch}. Uses `fetchInfiniteQuery` under the hood. */
|
|
130
|
+
prefetch: EventCallable<void>;
|
|
131
|
+
mounted: EventCallable<void>;
|
|
132
|
+
unmounted: EventCallable<void>;
|
|
133
|
+
/** See {@link QueryResult.$observer}. */
|
|
134
|
+
$observer: Store<InfiniteQueryObserver<any, TError, TData, QueryKey, TPageParam> | null>;
|
|
135
|
+
/** See {@link QueryResult.$queryClient}. */
|
|
136
|
+
$queryClient: Store<QueryClient | null>;
|
|
137
|
+
}
|
|
138
|
+
type CreateMutationOptions<TData = unknown, TError = Error, TVariables = void, TOnMutateResult = unknown> = MutationObserverOptions<TData, TError, TVariables, TOnMutateResult> & {
|
|
139
|
+
/** See {@link CreateQueryOptions.name}. */
|
|
140
|
+
name?: string;
|
|
141
|
+
};
|
|
142
|
+
type MutationStatus = 'idle' | 'pending' | 'success' | 'error';
|
|
143
|
+
interface MutationResult<TData = unknown, TError = Error, TVariables = void> {
|
|
144
|
+
/** The mutation result data, or `undefined` before success */
|
|
145
|
+
$data: Store<TData | undefined>;
|
|
146
|
+
/** The mutation error, or `null` if there is none */
|
|
147
|
+
$error: Store<TError | null>;
|
|
148
|
+
/** The mutation status: `'idle'` | `'pending'` | `'success'` | `'error'` */
|
|
149
|
+
$status: Store<MutationStatus>;
|
|
150
|
+
/** The variables passed to the last `mutate` call */
|
|
151
|
+
$variables: Store<TVariables | undefined>;
|
|
152
|
+
/** `true` while the mutation is paused (e.g. offline) and cannot run */
|
|
153
|
+
$isPaused: Store<boolean>;
|
|
154
|
+
/** `true` while the mutation is executing */
|
|
155
|
+
$isPending: Store<boolean>;
|
|
156
|
+
/** `true` when the mutation has succeeded */
|
|
157
|
+
$isSuccess: Store<boolean>;
|
|
158
|
+
/** `true` when the mutation has failed */
|
|
159
|
+
$isError: Store<boolean>;
|
|
160
|
+
/** `true` when the mutation has not yet been triggered */
|
|
161
|
+
$isIdle: Store<boolean>;
|
|
162
|
+
/** Per-scope MutationObserver. Created on `start()`. See {@link QueryResult.$observer}. */
|
|
163
|
+
$observer: Store<MutationObserver<TData, TError, TVariables, any> | null>;
|
|
164
|
+
/** See {@link QueryResult.$queryClient}. */
|
|
165
|
+
$queryClient: Store<QueryClient | null>;
|
|
166
|
+
/** Triggers the mutation with the given variables */
|
|
167
|
+
mutate: EventCallable<TVariables>;
|
|
168
|
+
/**
|
|
169
|
+
* Triggers the mutation with per-call callbacks layered on top of the
|
|
170
|
+
* observer-level ones. Use when you need component-local reactions
|
|
171
|
+
* (e.g. navigate after success) without module-level `sample` wiring.
|
|
172
|
+
*/
|
|
173
|
+
mutateWith: EventCallable<{
|
|
174
|
+
variables: TVariables;
|
|
175
|
+
onSuccess?: MutateOptions<TData, TError, TVariables>['onSuccess'];
|
|
176
|
+
onError?: MutateOptions<TData, TError, TVariables>['onError'];
|
|
177
|
+
onSettled?: MutateOptions<TData, TError, TVariables>['onSettled'];
|
|
178
|
+
}>;
|
|
179
|
+
/** Resets the mutation state back to idle */
|
|
180
|
+
reset: EventCallable<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Initializes the mutation observer subscription.
|
|
183
|
+
* Must be called before mutate to ensure stores receive updates.
|
|
184
|
+
*/
|
|
185
|
+
start: EventCallable<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Tears down the observer subscription. Call this when the consumer is
|
|
188
|
+
* destroyed (e.g. component unmount) so the queryClient can gc the
|
|
189
|
+
* mutation entry.
|
|
190
|
+
*/
|
|
191
|
+
unmounted: EventCallable<void>;
|
|
192
|
+
/**
|
|
193
|
+
* Sample-friendly events for module-level reactions to mutation outcome.
|
|
194
|
+
* Payloads include both the original `params` and the `result` / `error`,
|
|
195
|
+
* matching effector effect `done` / `fail` shape.
|
|
196
|
+
*/
|
|
197
|
+
finished: {
|
|
198
|
+
success: Event<{
|
|
199
|
+
params: TVariables;
|
|
200
|
+
result: TData;
|
|
201
|
+
}>;
|
|
202
|
+
failure: Event<{
|
|
203
|
+
params: TVariables;
|
|
204
|
+
error: TError;
|
|
205
|
+
}>;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type { CreateInfiniteQueryOptions, CreateMutationOptions, CreateQueryOptions, EffectorQueryKey, InfiniteQueryResult, MutationResult, MutationStatus, QueryResult, StoreOrValue };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@effector-tanstack-query/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Effector bindings for TanStack Query — core factories (createQuery, createMutation, createInfiniteQuery)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Ilya Agarkov <ilya.al.ag@gmail.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ilyaagarkov/effector-tanstack-query.git",
|
|
10
|
+
"directory": "packages/core"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/ilyaagarkov/effector-tanstack-query#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/ilyaagarkov/effector-tanstack-query/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"effector",
|
|
18
|
+
"tanstack",
|
|
19
|
+
"query",
|
|
20
|
+
"data-fetching",
|
|
21
|
+
"ssr"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "./dist/index.cjs",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./dist/index.d.cts",
|
|
35
|
+
"default": "./dist/index.cjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"src",
|
|
43
|
+
"!src/__tests__"
|
|
44
|
+
],
|
|
45
|
+
"sideEffects": false,
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"build:watch": "tsup --watch",
|
|
49
|
+
"clean": "rm -rf ./dist ./coverage",
|
|
50
|
+
"test": "vitest --run",
|
|
51
|
+
"test:watch": "vitest",
|
|
52
|
+
"test:types": "tsc --noEmit"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@tanstack/query-core": "^5.0.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"effector": ">=23.0.0"
|
|
59
|
+
}
|
|
60
|
+
}
|