@kwayteow/utils - v0.6.0
    Preparing search index...

    Interface DeduplicateOptions<T>

    缓存配置选项

    interface DeduplicateOptions<T extends any[]> {
        cacheTime?: number;
        keyFields?: number[];
        keyGenerator?: (...args: T) => string;
        shouldCache?: (...args: T) => boolean;
    }

    Type Parameters

    • T extends any[]
    Index

    Properties

    cacheTime?: number

    缓存结果的时间(毫秒),默认300ms

    keyFields?: number[]

    基于特定参数字段生成key的字段索引数组

    keyGenerator?: (...args: T) => string

    自定义缓存key生成器

    shouldCache?: (...args: T) => boolean

    条件缓存:返回false时不使用缓存