Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e42b727

Browse files
ChauChau
Chau
authored and
Chau
committed
refactor(core): clean up
1 parent e87f2af commit e42b727

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

libs/core/src/lib/portal.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export class NgtPortalAutoRender {
3939
renderPriority = input(1, { alias: 'autoRender', transform: (value) => numberAttribute(value, 1) });
4040

4141
constructor() {
42-
effect(() => {
43-
// this.portalStore.update((state) => ({ events: { ...state.events, priority: this.renderPriority() + 1 } }));
44-
});
42+
// TODO: (chau) investigate if this is still needed
43+
// effect(() => {
44+
// this.portalStore.update((state) => ({ events: { ...state.events, priority: this.renderPriority() + 1 } }));
45+
// });
4546

4647
effect((onCleanup) => {
4748
const portalRendered = this.portal.portalRendered();

libs/core/src/lib/store.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ export function storeFactory() {
211211
} = store.snapshot;
212212

213213
effect(() => {
214-
const newCamera = store.camera();
215-
const newSize = store.size();
216-
const newDpr = store.viewport.dpr();
217-
const gl = store.gl();
214+
const [newCamera, newSize, newDpr, gl] = [store.camera(), store.size(), store.viewport.dpr(), store.gl()];
218215

219216
// Resize camera and renderer on changes to size and pixel-ratio
220217
if (newSize !== oldSize || newDpr !== oldDpr) {

0 commit comments

Comments
 (0)