wonder.js
Version:
54 lines (45 loc) • 1.95 kB
JavaScript
;
var Most = require("most");
var Log$WonderLog = require("wonder-log/lib/js/src/Log.js");
function load(abPath, fetchFunc) {
return Most.fromPromise(fetchFunc(abPath).then((function (response) {
var match = !response.ok;
if (match) {
var status = response.status;
var statusText = response.statusText;
return Log$WonderLog.fatal(Log$WonderLog.buildFatalMessage("LoadABSystem->load", "" + (String(status) + (" " + (String(statusText) + ""))), "", "", ""));
} else {
return response.arrayBuffer();
}
})).then((function (ab) {
return Promise.resolve(ab);
})));
}
function getAssetBundlePath() {
return "";
}
function initAssetBundleArrayBufferCache() {
return new Promise((function (resolve, reject) {
return resolve();
}));
}
function isAssetBundleArrayBufferCached(abRelativePath, hashId) {
return new Promise((function (resolve, reject) {
return resolve(false);
}));
}
function getAssetBundleArrayBufferCache(abRelativePath) {
return Log$WonderLog.fatal(Log$WonderLog.buildFatalMessage("getAssetBundleArrayBufferCache", "need rewrite", "", "", ""));
}
function cacheAssetBundleArrayBuffer(abRelativePath, ab, hashId) {
return new Promise((function (resolve, reject) {
return resolve();
}));
}
exports.load = load;
exports.getAssetBundlePath = getAssetBundlePath;
exports.initAssetBundleArrayBufferCache = initAssetBundleArrayBufferCache;
exports.isAssetBundleArrayBufferCached = isAssetBundleArrayBufferCached;
exports.getAssetBundleArrayBufferCache = getAssetBundleArrayBufferCache;
exports.cacheAssetBundleArrayBuffer = cacheAssetBundleArrayBuffer;
/* most Not a pure module */