
Security News
Knip Hits 500 Releases with v5.62.0, Improving TypeScript Config Detection and Plugin Integrations
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
@tanstack/angular-query-experimental
Advanced tools
Signals for managing, caching and syncing asynchronous and remote data in Angular
IMPORTANT: This library is currently in an experimental stage. This means that breaking changes may happen in minor AND patch releases. Upgrade carefully. If you use this in production while in experimental stage, please lock your version to a patch-level version to avoid unexpected breaking changes.
Functions for fetching, caching and updating asynchronous data in Angular
Visit https://tanstack.com/query/latest/docs/framework/angular/overview
The Angular adapter for TanStack Query requires Angular 16 or higher.
angular-query
$ npm i @tanstack/angular-query-experimental
or
$ pnpm add @tanstack/angular-query-experimental
or
$ yarn add @tanstack/angular-query-experimental
or
$ bun add @tanstack/angular-query-experimental
import { provideTanStackQuery } from '@tanstack/angular-query-experimental'
import { QueryClient } from '@tanstack/angular-query-experimental'
bootstrapApplication(AppComponent, {
providers: [provideTanStackQuery(new QueryClient())],
})
or in a NgModule-based app
import { provideHttpClient } from '@angular/common/http'
import {
provideTanStackQuery,
QueryClient,
} from '@tanstack/angular-query-experimental'
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
providers: [provideTanStackQuery(new QueryClient())],
bootstrap: [AppComponent],
})
import { injectQuery } from '@tanstack/angular-query-experimental'
import { Component } from '@angular/core'
@Component({...})
export class TodosComponent {
info = injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList }))
}
@Component({})
export class PostComponent {
#postsService = inject(PostsService)
postId = input.required({
transform: numberAttribute,
})
postQuery = injectQuery(() => ({
queryKey: ['post', this.postId()],
queryFn: () => {
return lastValueFrom(this.#postsService.postById$(this.postId()))
},
}))
}
@Injectable({
providedIn: 'root',
})
export class PostsService {
#http = inject(HttpClient)
postById$ = (postId: number) =>
this.#http.get<Post>(`https://jsonplaceholder.typicode.com/posts/${postId}`)
}
export interface Post {
id: number
title: string
body: string
}
FAQs
Signals for managing, caching and syncing asynchronous and remote data in Angular
The npm package @tanstack/angular-query-experimental receives a total of 12,820 weekly downloads. As such, @tanstack/angular-query-experimental popularity was classified as popular.
We found that @tanstack/angular-query-experimental demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.