if we get a cache hit code (defaults 304), we use the cached response instead
Optional
disabledOptional
init: RequestInitOptional
init: RequestInitthis prevents Error to be thrown if have http error
optional validator for JSON response (Record<string, string | undefined>)
// using zod
const stringRecordSchema = z.record(z.string().min(1), z.string());
const validate: ValidateCallback<Record<string, string>> = async (data) => {
const result = await stringRecordSchema.safeParseAsync(data);
if (!result.success) {
return {success: false, message: result.error.message};
}
return {success: true};
};
Options for the FetchConfigLoader