coolant
Version:
The modular build radiator
11 lines (10 loc) • 332 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var event_1 = require("../event");
exports.cachingProvider = function (provider, cacheDuration) {
var cache = null;
event_1.periodically(function () {
cache = provider();
}, cacheDuration);
return function () { return cache; };
};