@tanstack/angular-query-experimental 5.87.3 → 5.87.5
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/index.d.ts +0 -1
- package/index.mjs +0 -2
- package/index.mjs.map +1 -1
- package/inject-queries-experimental/index.d.ts +1 -0
- package/inject-queries-experimental/index.mjs +5 -0
- package/inject-queries-experimental/index.mjs.map +1 -0
- package/mutation-options.d.ts +9 -5
- package/mutation-options.mjs.map +1 -1
- package/package.json +6 -2
package/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ export { injectMutation } from './inject-mutation.js';
|
|
|
18
18
|
export type { InjectMutationStateOptions } from './inject-mutation-state.js';
|
|
19
19
|
export { injectMutationState } from './inject-mutation-state.js';
|
|
20
20
|
export type { QueriesOptions, QueriesResults } from './inject-queries.js';
|
|
21
|
-
export { injectQueries } from './inject-queries.js';
|
|
22
21
|
export type { InjectQueryOptions } from './inject-query.js';
|
|
23
22
|
export { injectQuery } from './inject-query.js';
|
|
24
23
|
export { injectQueryClient } from './inject-query-client.js';
|
package/index.mjs
CHANGED
|
@@ -8,7 +8,6 @@ import { injectIsMutating } from "./inject-is-mutating.mjs";
|
|
|
8
8
|
import { injectIsRestoring, provideIsRestoring } from "./inject-is-restoring.mjs";
|
|
9
9
|
import { injectMutation } from "./inject-mutation.mjs";
|
|
10
10
|
import { injectMutationState } from "./inject-mutation-state.mjs";
|
|
11
|
-
import { injectQueries } from "./inject-queries.mjs";
|
|
12
11
|
import { injectQuery } from "./inject-query.mjs";
|
|
13
12
|
import { injectQueryClient } from "./inject-query-client.mjs";
|
|
14
13
|
import { provideQueryClient, provideTanStackQuery, queryFeature, queryFeatures, withDevtools } from "./providers.mjs";
|
|
@@ -20,7 +19,6 @@ export {
|
|
|
20
19
|
injectIsRestoring,
|
|
21
20
|
injectMutation,
|
|
22
21
|
injectMutationState,
|
|
23
|
-
injectQueries,
|
|
24
22
|
injectQuery,
|
|
25
23
|
injectQueryClient,
|
|
26
24
|
mutationOptions,
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../inject-queries.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/mutation-options.d.ts
CHANGED
|
@@ -15,17 +15,21 @@ import { CreateMutationOptions } from './types.js';
|
|
|
15
15
|
* mutationKey: ["updatePost", id],
|
|
16
16
|
* onSuccess: (newPost) => {
|
|
17
17
|
* // ^? newPost: Post
|
|
18
|
-
* this.queryClient.setQueryData(["posts", id], newPost)
|
|
18
|
+
* this.queryClient.setQueryData(["posts", id], newPost)
|
|
19
19
|
* },
|
|
20
20
|
* });
|
|
21
21
|
* }
|
|
22
22
|
* }
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* class ComponentOrService {
|
|
25
|
+
* queries = inject(QueriesService)
|
|
26
|
+
* id = signal(0)
|
|
27
|
+
* mutation = injectMutation(() => this.queries.updatePost(this.id()))
|
|
28
|
+
* }
|
|
27
29
|
*
|
|
28
|
-
*
|
|
30
|
+
* save() {
|
|
31
|
+
* this.mutation.mutate({ title: 'New Title' })
|
|
32
|
+
* }
|
|
29
33
|
* ```
|
|
30
34
|
* @param options - The mutation options.
|
|
31
35
|
* @returns Mutation options.
|
package/mutation-options.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-options.mjs","sources":["../src/mutation-options.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { CreateMutationOptions } from './types'\n\n/**\n * Allows to share and re-use mutation options in a type-safe way.\n *\n * **Example**\n *\n * ```ts\n * export class QueriesService {\n * private http = inject(HttpClient);\n *\n * updatePost(id: number) {\n * return mutationOptions({\n * mutationFn: (post: Post) => Promise.resolve(post),\n * mutationKey: [\"updatePost\", id],\n * onSuccess: (newPost) => {\n * // ^? newPost: Post\n * this.queryClient.setQueryData([\"posts\", id], newPost)
|
|
1
|
+
{"version":3,"file":"mutation-options.mjs","sources":["../src/mutation-options.ts"],"sourcesContent":["import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { CreateMutationOptions } from './types'\n\n/**\n * Allows to share and re-use mutation options in a type-safe way.\n *\n * **Example**\n *\n * ```ts\n * export class QueriesService {\n * private http = inject(HttpClient);\n *\n * updatePost(id: number) {\n * return mutationOptions({\n * mutationFn: (post: Post) => Promise.resolve(post),\n * mutationKey: [\"updatePost\", id],\n * onSuccess: (newPost) => {\n * // ^? newPost: Post\n * this.queryClient.setQueryData([\"posts\", id], newPost)\n * },\n * });\n * }\n * }\n *\n * class ComponentOrService {\n * queries = inject(QueriesService)\n * id = signal(0)\n * mutation = injectMutation(() => this.queries.updatePost(this.id()))\n * }\n *\n * save() {\n * this.mutation.mutate({ title: 'New Title' })\n * }\n * ```\n * @param options - The mutation options.\n * @returns Mutation options.\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n>(\n options: WithRequired<\n CreateMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationKey'\n >,\n): WithRequired<\n CreateMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n>(\n options: Omit<\n CreateMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationKey'\n >,\n): Omit<\n CreateMutationOptions<TData, TError, TVariables, TContext>,\n 'mutationKey'\n>\n\n/**\n * Allows to share and re-use mutation options in a type-safe way.\n *\n * **Example**\n *\n * ```ts\n * export class QueriesService {\n * private http = inject(HttpClient);\n *\n * updatePost(id: number) {\n * return mutationOptions({\n * mutationFn: (post: Post) => Promise.resolve(post),\n * mutationKey: [\"updatePost\", id],\n * onSuccess: (newPost) => {\n * // ^? newPost: Post\n * this.queryClient.setQueryData([\"posts\", id], newPost)\n * },\n * });\n * }\n * }\n *\n * class ComponentOrService {\n * queries = inject(QueriesService)\n * id = signal(0)\n * mutation = injectMutation(() => this.queries.updatePost(this.id()))\n * }\n *\n * save() {\n * this.mutation.mutate({ title: 'New Title' })\n * }\n * ```\n * @param options - The mutation options.\n * @returns Mutation options.\n */\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TContext = unknown,\n>(\n options: CreateMutationOptions<TData, TError, TVariables, TContext>,\n): CreateMutationOptions<TData, TError, TVariables, TContext> {\n return options\n}\n"],"names":[],"mappings":"AAoGO,SAAS,gBAMd,SAC4D;AACrD,SAAA;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/angular-query-experimental",
|
|
3
|
-
"version": "5.87.
|
|
3
|
+
"version": "5.87.5",
|
|
4
4
|
"description": "Signals for managing, caching and syncing asynchronous and remote data in Angular",
|
|
5
5
|
"author": "Arnoud de Vries",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,11 +35,15 @@
|
|
|
35
35
|
"types": "./index.d.ts",
|
|
36
36
|
"default": "./index.mjs"
|
|
37
37
|
},
|
|
38
|
+
"./inject-queries-experimental": {
|
|
39
|
+
"types": "./inject-queries-experimental/index.d.ts",
|
|
40
|
+
"default": "./inject-queries-experimental/index.mjs"
|
|
41
|
+
},
|
|
38
42
|
"./package.json": "./package.json"
|
|
39
43
|
},
|
|
40
44
|
"sideEffects": false,
|
|
41
45
|
"dependencies": {
|
|
42
|
-
"@tanstack/query-core": "5.87.
|
|
46
|
+
"@tanstack/query-core": "5.87.4",
|
|
43
47
|
"@tanstack/query-devtools": "5.87.3"
|
|
44
48
|
},
|
|
45
49
|
"peerDependencies": {
|