RxResourceOptions
Like ResourceOptions but uses an RxJS-based loader.
stream
(params: ResourceLoaderParams<R>) => Observable<T>A function that returns the Observable to load the resource's value from.
This Observable must eventually emit a value or an error before it completes — a resource
needs one of those two things to know what to show. If the Observable completes without ever
emitting anything (for example because of catchError(() => EMPTY)), Angular throws
RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE (NG0991), since it has nothing to give the
resource.
params
((ctx: ResourceParamsContext) => R) | undefinedA 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> | undefinedThe 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> | undefinedEquality function used to compare the return value of the loader.
injector
Injector | undefinedOverrides the Injector used by resource.
id
string | undefinedIdentifier 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.