Spec-Zone.ru › Angular

BaseResourceOptions

Options to the resource function, for creating a resource.

API

interface BaseResourceOptions<T, R> {
  params?: ((ctx: ResourceParamsContext) => R) | undefined;
  defaultValue?: NoInfer<T> | undefined;
  equal?: ValueEqualityFn<T> | undefined;
  injector?: Injector | undefined;
  id?: string | undefined;
}

params

((ctx: ResourceParamsContext) => R) | undefined

A reactive function which determines the request to be made. Whenever the request changes, the loader will be triggered to fetch a new value for the resource.

If a params function isn't provided, the loader won't rerun unless the resource is reloaded.

defaultValue

NoInfer<T> | undefined

The value which will be returned from the resource when a server value is unavailable, such as when the resource is still loading.

equal

ValueEqualityFn<T> | undefined

Equality function used to compare the return value of the loader.

injector

Injector | undefined

Overrides the Injector used by resource.

id

string | undefined

Identifier used to cache the resource data in the TransferState during server-side rendering and to retrieve it on the client side. This value value needs to be identical for both the client and server.

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/BaseResourceOptions

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API