UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

14 lines 650 B
import { forceGet } from "@lincode/utils"; import loadTexture from "./loadTexture"; import { decreaseLoadingAssetsCount, increaseLoadingAssetsCount } from "../../../states/useLoadingAssetsCount"; import { assetsPathPtr } from "../../../pointers/assetsPathPointers"; const cache = new Map(); export default (url) => forceGet(cache, url, () => new Promise((resolve) => { const isAssets = url.startsWith(assetsPathPtr[0]); isAssets && increaseLoadingAssetsCount(); const texture = loadTexture(url, () => { isAssets && decreaseLoadingAssetsCount(); resolve(texture); }); })); //# sourceMappingURL=loadTexturePromise.js.map