Caret/js/util/template.js

20 lines
438 B
JavaScript
Raw Normal View History

define(["util/inflate"], function(inflate) {
/*
A plugin that pre-loads templates into the util/inflate cache, then passes
it through (similar to how the settings! plugin works).
*/
return {
load: function(name, parentRequire, onLoad, config) {
var files = name.split(",");
var pending = files.map(inflate.load);
Promise.all(pending).then(function() {
onLoad(inflate);
});
}
2014-02-27 06:34:02 +00:00
};
});