Skip to content

Commit af5e8c6

Browse files
committed
refactor(core): remove unnecessary untracked in noZoneRender
1 parent 413a60c commit af5e8c6

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

Diff for: libs/core/src/lib/canvas.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,12 @@ export class NgtCanvas {
198198
this.store.get('events').connect?.(untracked(this.glCanvas).nativeElement);
199199
}
200200

201-
untracked(() => {
202-
this.glEnvironmentInjector = createEnvironmentInjector(
203-
[provideNgtRenderer(this.store)],
204-
this.environmentInjector,
205-
);
206-
this.glRef = untracked(this.glCanvasViewContainerRef).createComponent(untracked(this.sceneGraph), {
207-
environmentInjector: this.glEnvironmentInjector,
208-
injector: this.injector,
209-
});
210-
211-
this.glRef.changeDetectorRef.detectChanges();
201+
this.glEnvironmentInjector = createEnvironmentInjector([provideNgtRenderer(this.store)], this.environmentInjector);
202+
this.glRef = untracked(this.glCanvasViewContainerRef).createComponent(untracked(this.sceneGraph), {
203+
environmentInjector: this.glEnvironmentInjector,
204+
injector: this.injector,
212205
});
206+
207+
this.glRef.changeDetectorRef.detectChanges();
213208
}
214209
}

Diff for: libs/core/src/lib/utils/make.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function makeRendererInstance<TCanvas extends NgtCanvasElement>(
3232
if (is.renderer(customRenderer)) return customRenderer;
3333
return new WebGLRenderer({
3434
powerPreference: 'high-performance',
35-
canvas: canvas,
35+
canvas,
3636
antialias: true,
3737
alpha: true,
3838
...glOptions,

0 commit comments

Comments
 (0)