timdeschryver / query-state

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:Other


Languages

Language:TypeScript 90.0%Language:JavaScript 9.0%Language:HTML 0.8%Language:CSS 0.2%