[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/core/StreamingResourceOptions [Back]  [Original]

StreamingResourceOptions Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/core

StreamingResourceOptions

interface
stablesince v22.0

Options to the resource function, for creating a resource.

On this page

    arrow_upward_alt Back to the top

    API

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

    stream

    ResourceStreamingLoader<T, R>

    Loading function which returns a Promise of a signal of the resource's value for a given request, which can change over time as new values are received from a stream.

    loader

    undefined

    Cannot specify stream and loader at the same time.

    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.

    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page