🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
When I want to use isPending from mutation I'm getting wrong type. It's returning calculated signal but type is wrongly resolved to boolean. It's also happening to some other properties but I'm using only isPending in my project also I don't remember what others were that weren't working correctly.
import { Injectable, Signal } from "@angular/core";
import { injectMutation } from "@tanstack/angular-query-experimental";
@Injectable()
export class Service {
protected readonly mutation = injectMutation(() => ({
mutationFn: () => Promise.resolve({}),
}));
// TypeScript Error: `boolean` is not assignable to type `Signal<boolean>`
public readonly isProcessing: Signal<boolean> = this.mutation.isPending;
}
Expected behavior
isPending should be resolved to type Signal<boolean>
Describe the bug
When I want to use
isPending
from mutation I'm getting wrong type. It's returning calculated signal but type is wrongly resolved to boolean. It's also happening to some other properties but I'm using onlyisPending
in my project also I don't remember what others were that weren't working correctly.Your minimal, reproducible example
https://stackblitz.com/edit/stackblitz-starters-1t77xr?file=src%2Fmain.ts
Steps to reproduce
Expected behavior
isPending
should be resolved to typeSignal<boolean>
How often does this bug happen?
Every time
Screenshots or Videos
Platform
Tanstack Query adapter
angular-query
TanStack Query version
v5.35.3
TypeScript version
v5.4.5
Additional context
No response