angular-three 1.6.9 → 1.6.10

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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, Injectable, inject, InjectionToken, ViewContainerRef, TemplateRef, Directive, Input, EventEmitter, getDebugNode, RendererFactory2, ChangeDetectorRef, makeEnvironmentProviders, EnvironmentInjector, createEnvironmentInjector, Component, HostBinding, Output, ViewChild, Injector, Pipe, SkipSelf, ContentChild } from '@angular/core';
3
3
  import { provideNgxResizeOptions, NgxResize } from 'ngx-resize';
4
- import { isObservable, of, map, from, tap, retry, catchError, share, ReplaySubject, switchMap, forkJoin, take, BehaviorSubject, startWith, combineLatest, filter, distinctUntilChanged, takeUntil, merge } from 'rxjs';
4
+ import { isObservable, of, map, from, tap, retry, catchError, share, ReplaySubject, switchMap, forkJoin, take, BehaviorSubject, startWith, combineLatest, distinctUntilChanged, filter, takeUntil, merge } from 'rxjs';
5
5
  import * as THREE from 'three';
6
6
  import { DOCUMENT, NgForOf, NgIf } from '@angular/common';
7
7
  import { RxState, selectSlice } from '@rx-angular/state';
@@ -516,6 +516,7 @@ function tapEffect(effectFn) {
516
516
  class NgtRxStore extends RxState {
517
517
  constructor() {
518
518
  super();
519
+ this.cache = {};
519
520
  // set a dummy property so that initial this.get() won't return undefined
520
521
  this.set({ __ngt_dummy__: '__ngt_dummy__' });
521
522
  // call initialize that might be setup by derived Stores
@@ -555,6 +556,17 @@ class NgtRxStore extends RxState {
555
556
  requestAnimationFrame(() => void cdr.detectChanges());
556
557
  });
557
558
  }
559
+ key$(...keys) {
560
+ const key = keys.join('.');
561
+ if (!this.cache[key]) {
562
+ this.cache[key] = this.select(...keys).pipe(startWith(this.get(...keys) ?? undefined), distinctUntilChanged());
563
+ }
564
+ return this.cache[key];
565
+ }
566
+ ngOnDestroy() {
567
+ this.cache = {};
568
+ super.ngOnDestroy();
569
+ }
558
570
  }
559
571
  NgtRxStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: NgtRxStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
560
572
  NgtRxStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.3", ngImport: i0, type: NgtRxStore });