Optional
autoOptional
autotime in milliseconds after which the resource will be reloaded after expiring if autoReload is true. can be negative to reload before expiring
function that will be called to fetch the resource
Promise that resolves to the resource and the number of milliseconds before it expires
Optional
onfunction that will be called if fetcher throws an error
error thrown by fetcher
Optional
swrif true, the resource will keep returning expired data after it expires while the resource is being reloaded
Optional
swrif swr is true, this function will be called to validate if the cached data is still valid
if true, the resource will be automatically reloaded after autoReloadAfter milliseconds once the resource is expires
(note that it will need to be fetched manually at least once)