angular-three 4.0.0-next.14 → 4.0.0-next.15

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.
@@ -82,9 +82,9 @@ class NgtCommonDirective {
82
82
  this.injected = false;
83
83
  this.injectedValue = null;
84
84
  effect(() => {
85
- const value = this.linkedValue();
86
85
  if (this.shouldSkipRender())
87
86
  return;
87
+ const value = this.linkedValue();
88
88
  if (is.equ(value, this.injectedValue)) {
89
89
  // we have the same value as before, no need to update
90
90
  return;
@@ -614,6 +614,13 @@ function injectStore(options) {
614
614
  return inject(NGT_STORE, options);
615
615
  }
616
616
 
617
+ function resolveRef(ref) {
618
+ if (is.ref(ref)) {
619
+ return ref.nativeElement;
620
+ }
621
+ return ref;
622
+ }
623
+
617
624
  class NgtParent extends NgtCommonDirective {
618
625
  constructor() {
619
626
  super();
@@ -628,10 +635,7 @@ class NgtParent extends NgtCommonDirective {
628
635
  if (typeof rawParent === 'string') {
629
636
  return scene.getObjectByName(rawParent);
630
637
  }
631
- if ('nativeElement' in rawParent) {
632
- return rawParent.nativeElement;
633
- }
634
- return rawParent;
638
+ return resolveRef(rawParent);
635
639
  });
636
640
  this.linkedValue = linkedSignal(this._parent);
637
641
  this.shouldSkipRender = computed(() => !this._parent());
@@ -3044,13 +3048,6 @@ function injectBeforeRender(cb, { priority = 0, injector } = {}) {
3044
3048
  });
3045
3049
  }
3046
3050
 
3047
- function resolveRef(ref) {
3048
- if (is.ref(ref)) {
3049
- return ref.nativeElement;
3050
- }
3051
- return ref;
3052
- }
3053
-
3054
3051
  /**
3055
3052
  * As host directive:
3056
3053
  * - outputs: [