Search


Search something to see results

ApiChangeDetectionConfig

The configuration for the API Change Detection. Setting the config to true will use default values.

interface ApiChangeDetectionConfig {
    blacklist?: SpeedKitRule[];
    compare?: CompareFunction;
    compareKeys?: KeyCompareFunctions;
    onChange?: (urls: string[]) => void;
    sampleRate?: number;
    timeout?: number;
}

Index

Properties

Properties

blacklist?: SpeedKitRule[]

Excludes URLs from the API CD. Defaults to [].

compare?: CompareFunction

Can set a custom function to compare the cached with the remote API response.

compareKeys?: KeyCompareFunctions

Can set custom compare functions on individual keys of an API response. All other keys will be computed be the default compare function.

onChange?: (urls: string[]) => void

Gets called every time we detect an API change.

sampleRate?: number

Will set a percentage in which the API CD will execute. Defaults to 1.

timeout?: number

How long to wait in milliseconds until starting the API CD after detecting a matching request. Defaults to 1000ms.