The Angular adapter is now available for TanStack Query v5.
postQuery = injectQuery(() => ({
enabled: this.postId() > 0,
queryKey: ['post', this.postId()],
queryFn: () => lastValueFrom(this.getPost$(this.postId()))
}))
postQuery = injectQuery(() => ({
enabled: this.postId() > 0,
queryKey: ['post', this.postId()],
queryFn: () => lastValueFrom(this.getPost$(this.postId()))
}))
It's based on Angular signals and compatible with Angular v16+.
Check the complete documentation: Angular Query overview.