Spaces:
Running
Running
File size: 701 Bytes
6bcb42f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
const asyncLibrary = callback => {
let data = null;
return () => {
if (data) return data;
return callback()
.then(mod => (data = mod.default));
};
};
export const getBackdropLibrary = asyncLibrary(
() => import(/* webpackChunkName: "library-backdrops" */ './backdrops.json')
);
export const getCostumeLibrary = asyncLibrary(
() => import(/* webpackChunkName: "library-costumes" */ './costumes.json')
);
export const getSoundLibrary = asyncLibrary(
() => import(/* webpackChunkName: "library-sounds" */ './sounds.json')
);
export const getSpriteLibrary = asyncLibrary(
() => import(/* webpackChunkName: "library-sprites" */ './sprites.json')
);
|