@hazae41/glacier
Version:
Yet another React data (re)fetching library
47 lines (44 loc) • 1.17 kB
JavaScript
'use strict';
function shouldUseCacheIfFresh(cache) {
if (cache === "default")
return true;
if (cache === "reload")
return false;
if (cache === "no-cache")
return false;
if (cache === "force-cache")
return true;
if (cache === "only-if-cached")
return true;
return true;
}
function shouldUseCacheIfStale(cache) {
if (cache === "default")
return false;
if (cache === "reload")
return false;
if (cache === "no-cache")
return false;
if (cache === "force-cache")
return true;
if (cache === "only-if-cached")
return true;
return false;
}
function shouldUseNetwork(cache) {
if (cache === "default")
return true;
if (cache === "reload")
return true;
if (cache === "no-cache")
return true;
if (cache === "force-cache")
return true;
if (cache === "only-if-cached")
return false;
return true;
}
exports.shouldUseCacheIfFresh = shouldUseCacheIfFresh;
exports.shouldUseCacheIfStale = shouldUseCacheIfStale;
exports.shouldUseNetwork = shouldUseNetwork;
//# sourceMappingURL=index.cjs.map