MCPcopy Create free account
hub / github.com/melonjs/melonJS / completeLoading

Function completeLoading

packages/melonjs/src/loader/loader.js:242–251  ·  view source on GitHub ↗

* Complete loading: invoke the callback and emit the LOADER_COMPLETE event. * @param {Function} onloadcb - the completion callback * @ignore

(onloadcb)

Source from the content-addressed store, hash-verified

240 * @ignore
241 */
242function completeLoading(onloadcb) {
243 const callback = onloadcb || onload;
244 if (typeof callback === "function") {
245 callback();
246 }
247 // always signal completion — with the Promise form of preload() a callback
248 // is optional (you can `await` instead), so a missing callback is no longer
249 // an error; the loading screen / consumers react to LOADER_COMPLETE.
250 emit(LOADER_COMPLETE);
251}
252
253/**
254 * just increment the number of already loaded resources

Callers 2

preloadFunction · 0.85
reloadFunction · 0.85

Calls 2

emitFunction · 0.90
callbackFunction · 0.50

Tested by

no test coverage detected