Skip to content

Commit 907087f

Browse files
authored
refactor(angular-query): make injectIsMutating signal read-only (#9801)
1 parent 27df987 commit 907087f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/angular-query-experimental': patch
3+
---
4+
5+
Make `injectIsMutating` signal read-only to prevent external modifications to the internal state

packages/angular-query-experimental/src/inject-is-mutating.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface InjectIsMutatingOptions {
2525
* Can be used for app-wide loading indicators
2626
* @param filters - The filters to apply to the query.
2727
* @param options - Additional configuration
28-
* @returns signal with number of fetching mutations.
28+
* @returns A read-only signal with the number of fetching mutations.
2929
*/
3030
export function injectIsMutating(
3131
filters?: MutationFilters,
@@ -60,5 +60,5 @@ export function injectIsMutating(
6060

6161
destroyRef.onDestroy(unsubscribe)
6262

63-
return result
63+
return result.asReadonly()
6464
}

packages/angular-query-experimental/tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
"useDefineForClassFields": false,
88
"target": "ES2022"
99
},
10+
"angularCompilerOptions": {
11+
"enableI18nLegacyMessageIdFormat": false,
12+
"strictInjectionParameters": true,
13+
"strictInputAccessModifiers": true,
14+
"strictStandalone": true,
15+
"strictTemplates": true
16+
},
1017
"include": ["src", "scripts", "test-setup.ts", "*.config.*", "package.json"],
1118
"references": [{ "path": "../query-core" }, { "path": "../query-devtools" }]
1219
}

0 commit comments

Comments
 (0)