@hkdigital/lib-core 0.4.75 → 0.4.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -380,12 +380,31 @@ export default class SceneBase {
380
380
  return;
381
381
  }
382
382
 
383
+ // Start all loaders
383
384
  for (let i = 0; i < this.sources.length; i++) {
384
385
  const source = this.sources[i];
385
386
  const loader = this.getLoaderFromSource(source);
386
-
387
387
  loader.load();
388
388
  }
389
+
390
+ // Check if all loaders have already completed synchronously (e.g., from cache)
391
+ setTimeout(() => {
392
+ if (this.#state.current === STATE_LOADING) {
393
+ let allLoaded = true;
394
+ for (const source of this.sources) {
395
+ const loader = this.getLoaderFromSource(source);
396
+ if (loader.state !== STATE_LOADED) {
397
+ allLoaded = false;
398
+ break;
399
+ }
400
+ }
401
+
402
+ if (allLoaded) {
403
+ console.debug('SceneBase:all-loaders-already-loaded, sending LOADED');
404
+ this.#state.send(LOADED);
405
+ }
406
+ }
407
+ }, 0);
389
408
  }
390
409
 
391
410
  #startAbort() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.4.75",
3
+ "version": "0.4.77",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"