feat: added ability to set custom cache

This commit is contained in:
anuraghazra
2020-07-20 21:43:51 +05:30
parent dd2c7ed278
commit fdf445d734
5 changed files with 134 additions and 34 deletions
+12
View File
@@ -44,6 +44,10 @@ function parseBoolean(value) {
}
}
function clampValue(number, min, max) {
return Math.max(min, Math.min(number, max));
}
function fallbackColor(color, fallbackColor) {
return (isValidHexColor(color) && `#${color}`) || fallbackColor;
}
@@ -112,6 +116,12 @@ function getCardColors({
return { titleColor, iconColor, textColor, bgColor };
}
const CONSTANTS = {
THIRTY_MINUTES: 1800,
TWO_HOURS: 7200,
ONE_DAY: 86400,
};
module.exports = {
renderError,
kFormatter,
@@ -122,4 +132,6 @@ module.exports = {
fallbackColor,
FlexLayout,
getCardColors,
clampValue,
CONSTANTS,
};