angular-three 1.6.7 → 1.6.8

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.
@@ -459,6 +459,19 @@ function applyProps(instance, props) {
459
459
  return instance;
460
460
  }
461
461
 
462
+ function safeDetectChanges(cdr) {
463
+ if (!cdr)
464
+ return;
465
+ try {
466
+ if (cdr['context']) {
467
+ cdr.detectChanges();
468
+ }
469
+ }
470
+ catch (e) {
471
+ cdr.markForCheck();
472
+ }
473
+ }
474
+
462
475
  const startWithUndefined = () => startWith(undefined);
463
476
  /**
464
477
  * An extended `tap` operator that accepts an `effectFn` which:
@@ -534,12 +547,12 @@ class NgtRxStore extends RxState {
534
547
  return modded;
535
548
  }, {});
536
549
  const value = originalSet(modArgs);
537
- cdr?.detectChanges();
550
+ safeDetectChanges(cdr);
538
551
  return value;
539
552
  }
540
553
  // @ts-expect-error not sure why ...args here doesn't pass tuple check
541
554
  const value = originalSet(...args);
542
- cdr?.detectChanges();
555
+ safeDetectChanges(cdr);
543
556
  return value;
544
557
  };
545
558
  },
@@ -2587,17 +2600,6 @@ function injectBeforeRender(cb, priority = 0) {
2587
2600
  }
2588
2601
  }
2589
2602
 
2590
- function safeDetectChanges(cdr) {
2591
- try {
2592
- if (cdr['context']) {
2593
- cdr.detectChanges();
2594
- }
2595
- }
2596
- catch (e) {
2597
- cdr.markForCheck();
2598
- }
2599
- }
2600
-
2601
2603
  function injectNgtRef(initialValue = null) {
2602
2604
  const ref = is.ref(initialValue) ? initialValue : new ElementRef(initialValue);
2603
2605
  let lastValue = ref.nativeElement;