Like ResourceOptions but uses an RxJS-based loader.
API
interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> { stream: (params: ResourceLoaderParams<R>) => Observable<T>; override params?: (() => R) | undefined; override defaultValue?: NoInfer<T> | undefined; override equal?: ValueEqualityFn<T> | undefined; override injector?: Injector | undefined;}
stream
(params: ResourceLoaderParams<R>) => Observable<T>params
(() => 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.
Jump to details