Skip to content

Commit 3e36bca

Browse files
committed
fix: revert detect changes in store
1 parent 74cff39 commit 3e36bca

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

libs/angular-three/src/lib/stores/rx-store.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { ChangeDetectorRef, inject, Injectable } from '@angular/core';
1+
import { ChangeDetectorRef, Injectable } from '@angular/core';
22
import { RxState } from '@rx-angular/state';
33
import { combineLatest, MonoTypeOperatorFunction, Observable, startWith, tap } from 'rxjs';
44
import type { NgtAnyRecord } from '../types';
55
import { is } from '../utils/is';
6-
import { safeDetectChanges } from '../utils/safe-detect-changes';
76

87
export const startWithUndefined = <T>(): MonoTypeOperatorFunction<T> => startWith<T>(undefined! as T);
98

@@ -77,7 +76,6 @@ export class NgtRxStore<
7776
> extends RxState<TRxState> {
7877
constructor() {
7978
super();
80-
const cdr = inject(ChangeDetectorRef, { optional: true });
8179
// set a dummy property so that initial this.get() won't return undefined
8280
this.set({ __ngt_dummy__: '__ngt_dummy__' } as TRxState);
8381
// call initialize that might be setup by derived Stores
@@ -94,14 +92,10 @@ export class NgtRxStore<
9492
modded[key] = value === undefined ? this.get(key as keyof TRxState) : value;
9593
return modded;
9694
}, {} as NgtAnyRecord);
97-
const value = originalSet(modArgs as Partial<TRxState>);
98-
safeDetectChanges(cdr);
99-
return value;
95+
return originalSet(modArgs as Partial<TRxState>);
10096
}
10197
// @ts-expect-error not sure why ...args here doesn't pass tuple check
102-
const value = originalSet(...args);
103-
safeDetectChanges(cdr);
104-
return value;
98+
return originalSet(...args);
10599
};
106100
},
107101
});

0 commit comments

Comments
 (0)