ChemPal Documentation - v1.6.0
    Preparing search index...

    Interface TtlCacheOptions<Args>

    Options controlling a withTtlCache wrapper.

    export interface TtlCacheOptions<Args extends unknown[]> {
    /** Namespace segment separating one wrapped function's keys from another's. */
    namespace: string;
    /** How long a cached entry stays fresh, in ms. Defaults to {@link THREE_DAYS_MS}. */
    ttlMs?: number;
    /** Derives the cache key from the call arguments. Defaults to `JSON.stringify(args)`. */
    keyFromArgs?: (...args: Args) => string;
    }
    interface TtlCacheOptions<Args extends unknown[]> {
        namespace: string;
        ttlMs?: number;
        keyFromArgs?: (...args: Args) => string;
    }

    Type Parameters

    • Args extends unknown[]
    Index

    Properties

    namespace: string

    Namespace segment separating one wrapped function's keys from another's.

    ttlMs?: number

    How long a cached entry stays fresh, in ms. Defaults to THREE_DAYS_MS.

    keyFromArgs?: (...args: Args) => string

    Derives the cache key from the call arguments. Defaults to JSON.stringify(args).