mylingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
15 lines • 546 B
JavaScript
import { assert, forceGet } from "@lincode/utils";
import { FileLoader } from "three";
import { handleProgress } from "./bytesLoaded";
const cache = new Map();
const loader = new FileLoader();
export default (url) => forceGet(cache, url, () => new Promise((resolve, reject) => {
loader.load(url, (data) => {
try {
assert(typeof data === "string");
resolve(Object.freeze(JSON.parse(data)));
}
catch { }
}, handleProgress(url), reject);
}));
//# sourceMappingURL=loadJSON.js.map