You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()exportclassService{protectedreadonlymutation=injectMutation(()=>({mutationFn: ()=>Promise.resolve({}),}));// TypeScript Error: `boolean` is not assignable to type `Signal<boolean>`publicreadonlyisProcessing: Signal<boolean>=this.mutation.isPending;}
Expected behavior
isPending should be resolved to type Signal<boolean>
How often does this bug happen?
Every time
Screenshots or Videos
Platform
OS: Windows
Browser: not important
Version: not important
Tanstack Query adapter
angular-query
TanStack Query version
v5.35.3
TypeScript version
v5.4.5
Additional context
No response
The text was updated successfully, but these errors were encountered:
k3nsei
changed the title
isPending type isn't boxed as Signal
[angular] isPending type isn't boxed as Signal
May 16, 2024
k3nsei
changed the title
[angular] isPending type isn't boxed as Signal
[angular] isPending type isn't typed as Signal
May 16, 2024
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
The text was updated successfully, but these errors were encountered: