@tanstack/solid-query 5.36.0 → 5.37.1
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/build/dev.cjs +1 -3
- package/build/dev.js +1 -3
- package/build/index.cjs +1 -3
- package/build/index.d.cts +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -3
- package/package.json +5 -15
- package/src/__tests__/useMutationState.test-d.tsx +1 -3
- package/src/useMutationState.ts +2 -9
package/build/dev.cjs
CHANGED
|
@@ -380,9 +380,7 @@ function useIsMutating(filters, queryClient) {
|
|
|
380
380
|
}
|
|
381
381
|
function getResult(mutationCache, options) {
|
|
382
382
|
return mutationCache.findAll(options.filters).map(
|
|
383
|
-
(mutation) => options.select ? options.select(
|
|
384
|
-
mutation
|
|
385
|
-
) : mutation.state
|
|
383
|
+
(mutation) => options.select ? options.select(mutation) : mutation.state
|
|
386
384
|
);
|
|
387
385
|
}
|
|
388
386
|
function useMutationState(options = () => ({}), queryClient) {
|
package/build/dev.js
CHANGED
|
@@ -379,9 +379,7 @@ function useIsMutating(filters, queryClient) {
|
|
|
379
379
|
}
|
|
380
380
|
function getResult(mutationCache, options) {
|
|
381
381
|
return mutationCache.findAll(options.filters).map(
|
|
382
|
-
(mutation) => options.select ? options.select(
|
|
383
|
-
mutation
|
|
384
|
-
) : mutation.state
|
|
382
|
+
(mutation) => options.select ? options.select(mutation) : mutation.state
|
|
385
383
|
);
|
|
386
384
|
}
|
|
387
385
|
function useMutationState(options = () => ({}), queryClient) {
|
package/build/index.cjs
CHANGED
|
@@ -371,9 +371,7 @@ function useIsMutating(filters, queryClient) {
|
|
|
371
371
|
}
|
|
372
372
|
function getResult(mutationCache, options) {
|
|
373
373
|
return mutationCache.findAll(options.filters).map(
|
|
374
|
-
(mutation) => options.select ? options.select(
|
|
375
|
-
mutation
|
|
376
|
-
) : mutation.state
|
|
374
|
+
(mutation) => options.select ? options.select(mutation) : mutation.state
|
|
377
375
|
);
|
|
378
376
|
}
|
|
379
377
|
function useMutationState(options = () => ({}), queryClient) {
|
package/build/index.d.cts
CHANGED
|
@@ -120,7 +120,7 @@ declare function useIsMutating(filters?: Accessor<MutationFilters>, queryClient?
|
|
|
120
120
|
|
|
121
121
|
type MutationStateOptions<TResult = MutationState> = {
|
|
122
122
|
filters?: MutationFilters;
|
|
123
|
-
select?: (mutation: Mutation
|
|
123
|
+
select?: (mutation: Mutation) => TResult;
|
|
124
124
|
};
|
|
125
125
|
declare function useMutationState<TResult = MutationState>(options?: Accessor<MutationStateOptions<TResult>>, queryClient?: Accessor<QueryClient>): Accessor<Array<TResult>>;
|
|
126
126
|
|
package/build/index.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ declare function useIsMutating(filters?: Accessor<MutationFilters>, queryClient?
|
|
|
120
120
|
|
|
121
121
|
type MutationStateOptions<TResult = MutationState> = {
|
|
122
122
|
filters?: MutationFilters;
|
|
123
|
-
select?: (mutation: Mutation
|
|
123
|
+
select?: (mutation: Mutation) => TResult;
|
|
124
124
|
};
|
|
125
125
|
declare function useMutationState<TResult = MutationState>(options?: Accessor<MutationStateOptions<TResult>>, queryClient?: Accessor<QueryClient>): Accessor<Array<TResult>>;
|
|
126
126
|
|
package/build/index.js
CHANGED
|
@@ -370,9 +370,7 @@ function useIsMutating(filters, queryClient) {
|
|
|
370
370
|
}
|
|
371
371
|
function getResult(mutationCache, options) {
|
|
372
372
|
return mutationCache.findAll(options.filters).map(
|
|
373
|
-
(mutation) => options.select ? options.select(
|
|
374
|
-
mutation
|
|
375
|
-
) : mutation.state
|
|
373
|
+
(mutation) => options.select ? options.select(mutation) : mutation.state
|
|
376
374
|
);
|
|
377
375
|
}
|
|
378
376
|
function useMutationState(options = () => ({}), queryClient) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.37.1",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,25 +44,15 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"solid-js": "^1.8.
|
|
48
|
-
"@tanstack/query-core": "5.36.
|
|
47
|
+
"solid-js": "^1.8.17",
|
|
48
|
+
"@tanstack/query-core": "5.36.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup-preset-solid": "^2.2.0",
|
|
52
|
-
"vite-plugin-solid": "^2.
|
|
52
|
+
"vite-plugin-solid": "^2.10.2"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"solid-js": "^1.6.0"
|
|
56
56
|
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"clean": "rimraf ./build && rimraf ./coverage",
|
|
59
|
-
"test:eslint": "eslint --ext .ts,.tsx ./src",
|
|
60
|
-
"test:types": "tsc",
|
|
61
|
-
"test:lib": "vitest --retry=3",
|
|
62
|
-
"test:lib:dev": "pnpm run test:lib --watch",
|
|
63
|
-
"test:build": "publint --strict",
|
|
64
|
-
"test:attw": "attw --pack",
|
|
65
|
-
"build": "tsup",
|
|
66
|
-
"build:watch": "tsup --watch"
|
|
67
|
-
}
|
|
57
|
+
"scripts": {}
|
|
68
58
|
}
|
|
@@ -8,9 +8,7 @@ describe('useMutationState', () => {
|
|
|
8
8
|
filters: { status: 'pending' },
|
|
9
9
|
}))
|
|
10
10
|
|
|
11
|
-
expectTypeOf(result()).toEqualTypeOf<
|
|
12
|
-
Array<MutationState<unknown, Error, void, unknown>>
|
|
13
|
-
>()
|
|
11
|
+
expectTypeOf(result()).toEqualTypeOf<Array<MutationState>>()
|
|
14
12
|
})
|
|
15
13
|
it('should infer with select', () => {
|
|
16
14
|
const result = useMutationState(() => ({
|
package/src/useMutationState.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { createEffect, createMemo, createSignal, onCleanup } from 'solid-js'
|
|
|
2
2
|
import { replaceEqualDeep } from '@tanstack/query-core'
|
|
3
3
|
import { useQueryClient } from './QueryClientProvider'
|
|
4
4
|
import type {
|
|
5
|
-
DefaultError,
|
|
6
5
|
Mutation,
|
|
7
6
|
MutationCache,
|
|
8
7
|
MutationFilters,
|
|
@@ -13,9 +12,7 @@ import type { QueryClient } from './QueryClient'
|
|
|
13
12
|
|
|
14
13
|
type MutationStateOptions<TResult = MutationState> = {
|
|
15
14
|
filters?: MutationFilters
|
|
16
|
-
select?: (
|
|
17
|
-
mutation: Mutation<unknown, DefaultError, unknown, unknown>,
|
|
18
|
-
) => TResult
|
|
15
|
+
select?: (mutation: Mutation) => TResult
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
function getResult<TResult = MutationState>(
|
|
@@ -26,11 +23,7 @@ function getResult<TResult = MutationState>(
|
|
|
26
23
|
.findAll(options.filters)
|
|
27
24
|
.map(
|
|
28
25
|
(mutation): TResult =>
|
|
29
|
-
(options.select
|
|
30
|
-
? options.select(
|
|
31
|
-
mutation as Mutation<unknown, DefaultError, unknown, unknown>,
|
|
32
|
-
)
|
|
33
|
-
: mutation.state) as TResult,
|
|
26
|
+
(options.select ? options.select(mutation) : mutation.state) as TResult,
|
|
34
27
|
)
|
|
35
28
|
}
|
|
36
29
|
|