ApiChangeDetectionConfig
interface ApiChangeDetectionConfig {
blacklist?: SpeedKitRule[];
compare?: CompareFunction;
compareKeys?: KeyCompareFunctions;
onChange?: (urls: string[]) => void;
sampleRate?: number;
timeout?: number;
}
blacklist?: SpeedKitRule[];
compare?: CompareFunction;
compareKeys?: KeyCompareFunctions;
onChange?: (urls: string[]) => void;
sampleRate?: number;
timeout?: number;
}
Index
Properties
Properties
Optional
blacklist
Excludes URLs from the API CD.
Defaults to []
.
Optional
compare
Can set a custom function to compare the cached with the remote API response.
Optional
compare Keys
Can set custom compare functions on individual keys of an API response. All other keys will be computed be the default compare function.
Optional
on Change
onChange?: (urls: string[]) => void
Gets called every time we detect an API change.
Optional
sample Rate
sampleRate?: number
Will set a percentage in which the API CD will execute.
Defaults to 1
.
Optional
timeout
timeout?: number
How long to wait in milliseconds until starting the API CD after detecting a matching request. Defaults to 1000ms.
The configuration for the API Change Detection. Setting the config to
true
will use default values.