@wolkabout/commons 0.0.10 → 0.0.12

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.
@@ -66,7 +66,7 @@ import * as i32 from '@angular/cdk/drag-drop';
66
66
  import { DragDropModule } from '@angular/cdk/drag-drop';
67
67
  import * as i0 from '@angular/core';
68
68
  import { InjectionToken, inject, Injectable, Injector, runInInjectionContext, DOCUMENT, Inject, Input, Directive, forwardRef, HostListener, TemplateRef, PLATFORM_ID, Pipe, ViewChild, ContentChild, Optional, Self, Component, input, computed, untracked, signal, viewChild, afterNextRender, effect, output, afterRenderEffect, contentChild } from '@angular/core';
69
- import { BehaviorSubject, catchError, of, switchMap, EMPTY, tap, filter, map, combineLatestWith, forkJoin, from, distinctUntilChanged, shareReplay, merge, Subject, takeUntil, combineLatest, take, first } from 'rxjs';
69
+ import { BehaviorSubject, catchError, of, switchMap, EMPTY, tap, filter, map, combineLatestWith, from, mergeMap, distinctUntilChanged, shareReplay, merge, Subject, takeUntil, combineLatest, take, first } from 'rxjs';
70
70
  import { jwtDecode } from 'jwt-decode';
71
71
  import { loadRemoteModule } from '@angular-architects/native-federation';
72
72
  import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
@@ -428,11 +428,10 @@ class FeatureRegistry {
428
428
  registerFeature(feature) {
429
429
  runInInjectionContext(this.injector, () => feature.init?.());
430
430
  this._features$.next([...this._features$.value, feature].sort((a, b) => a.order - b.order));
431
+ console.info('Loaded feature: ', feature.name);
431
432
  }
432
433
  loadExternalFeatures(features) {
433
- forkJoin(features.map(externalFeature => from(loadRemoteModule(externalFeature.remote, externalFeature.feature)).pipe(map(module => module.default), catchError(() => of(null))))).pipe(map(list => list.filter((x) => x !== null))).subscribe((externalFeatures) => {
434
- externalFeatures.forEach(feature => this.registerFeature(feature));
435
- });
434
+ from(features).pipe(mergeMap(externalFeature => from(loadRemoteModule(externalFeature.remote, externalFeature.feature)).pipe(map(module => module.default), catchError(() => of(null)))), filter((x) => x !== null)).subscribe(feature => this.registerFeature(feature));
436
435
  }
437
436
  get features$() {
438
437
  return this._features$.asObservable();