@adobe/data - v0.10.30
    Preparing search index...

    Interface WithCacheOptions

    interface WithCacheOptions {
        release?: boolean;
    }
    Index

    Properties

    Properties

    release?: boolean

    When true (the default) the cache is reference-counted: the single upstream subscription is opened on the first observer and torn down — and the cached value cleared — when the last observer unsubscribes, so the next observer re-subscribes and sees a freshly computed value. Use the default for a source that holds an active resource (a poll, a socket, an event listener) that should stop while nobody is listening, or that must be re-read fresh each time.

    When false the upstream subscription is kept alive for the lifetime of the returned observable and the last value is retained, so every new observer — including one that subscribes after all previous observers have left — is replayed the current value synchronously and never stalls waiting for a fresh emission. Use it for a long-lived, app-scoped source a subscribe-once consumer must be able to read immediately regardless of subscription timing (e.g. an async value feeding fromProperties, where a cold cache would stall the combination).