raptor
Version:
RaptorJS provides an AMD module loader that works in Node, Rhino and the web browser. It also includes various sub-modules to support building optimized web applications.
30 lines (24 loc) • 749 B
JavaScript
define(
'raptor/caching/BaseCache',
function(require) {
"use strict";
var BaseCache = function() {
};
BaseCache.prototype = {
put: function(key, value) {
this.doPut(key, value);
},
get: function(key, createFunc) {
var value = this.doGet(key);
if (value === undefined && createFunc) {
value = createFunc();
if (value === undefined) {
value = null;
}
this.doPut(key, value);
}
return value;
}
};
return BaseCache;
});