File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 11import {
22 DestroyRef ,
33 Directive ,
4- EmbeddedViewRef ,
54 Injector ,
65 TemplateRef ,
76 ViewContainerRef ,
@@ -113,20 +112,15 @@ export class NgtsFBO {
113112 private viewContainerRef = inject ( ViewContainerRef ) ;
114113
115114 constructor ( ) {
116- let ref : EmbeddedViewRef < { $implicit : ReturnType < typeof fbo > } > ;
117-
118115 const fboTarget = fbo ( ( ) => {
119116 const { width, height, ...settings } = this . fbo ( ) ;
120117 return { width, height, settings } ;
121118 } ) ;
122119
123- effect ( ( ) => {
124- ref = this . viewContainerRef . createEmbeddedView ( this . template , { $implicit : fboTarget } ) ;
120+ effect ( ( onCleanup ) => {
121+ const ref = this . viewContainerRef . createEmbeddedView ( this . template , { $implicit : fboTarget } ) ;
125122 ref . detectChanges ( ) ;
126- } ) ;
127-
128- inject ( DestroyRef ) . onDestroy ( ( ) => {
129- ref ?. destroy ( ) ;
123+ onCleanup ( ( ) => void ref . destroy ( ) ) ;
130124 } ) ;
131125 }
132126
You can’t perform that action at this time.
0 commit comments