Skip to content

Commit 3d074b5

Browse files
committed
fix: adjust overriden get logic
1 parent aa50b90 commit 3d074b5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

apps/example/src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { provideRouter, withDebugTracing } from '@angular/router';
2+
import { provideRouter } from '@angular/router';
33
import { AppComponent } from './app/app.component';
44

55
bootstrapApplication(AppComponent, {
@@ -16,8 +16,8 @@ bootstrapApplication(AppComponent, {
1616
loadComponent: () => import('./app/scene/scene.component'),
1717
loadChildren: () => import('./app/scene/scene.routes'),
1818
},
19-
],
20-
withDebugTracing()
19+
]
20+
// withDebugTracing()
2121
),
2222
],
2323
}).catch((err) => console.error(err));

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ export class NgtRxStore<TState extends object = any, TRxState extends object = T
101101
Object.defineProperty(this, 'get', {
102102
get: () => {
103103
return (...args: Parameters<RxState<TRxState>['get']>) => {
104-
const state = originalGet(...args);
105-
return state || {};
104+
if ((args as any[]).length === 0) {
105+
return originalGet() ?? {};
106+
}
107+
return originalGet(...args);
106108
};
107109
},
108110
});

0 commit comments

Comments
 (0)