Skip to content

timdeschryver/query-state

Repository files navigation

Query State

Simple and configurable query helpers.

@Component({
  selector: 'query-state-detail',
  template: `
    <query-state-template [queryState]="queryState.data$">
      <ng-template
        [qsIdle]="queryState.data$"
        let-detail
        let-revalidating="revalidating"
      >
        <pre>{{ detail | json }}</pre>
      </ng-template>
    </query-state-template>
  `,
  imports: [JsonPipe, AsyncPipe, QueryStateTemplateComponent],
  standalone: true,
})
export class DetailComponent {
  queryState = injectQueryState();
}

query-state

Helpers to automatically fetch and revalidate query data. Template helpers to show the query state and response.

Includes

  • Caching
  • Request state
  • Retries (with configuration)
  • Revalidate on interval, focus, online detection
  • Configurable default templates

Docs

Todo

  • Prefetch
  • BroadcastChannel

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published