File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
2
DestroyRef ,
3
3
Directive ,
4
- EmbeddedViewRef ,
5
4
Injector ,
6
5
TemplateRef ,
7
6
ViewContainerRef ,
@@ -113,20 +112,15 @@ export class NgtsFBO {
113
112
private viewContainerRef = inject ( ViewContainerRef ) ;
114
113
115
114
constructor ( ) {
116
- let ref : EmbeddedViewRef < { $implicit : ReturnType < typeof fbo > } > ;
117
-
118
115
const fboTarget = fbo ( ( ) => {
119
116
const { width, height, ...settings } = this . fbo ( ) ;
120
117
return { width, height, settings } ;
121
118
} ) ;
122
119
123
- effect ( ( ) => {
124
- ref = this . viewContainerRef . createEmbeddedView ( this . template , { $implicit : fboTarget } ) ;
120
+ effect ( ( onCleanup ) => {
121
+ const ref = this . viewContainerRef . createEmbeddedView ( this . template , { $implicit : fboTarget } ) ;
125
122
ref . detectChanges ( ) ;
126
- } ) ;
127
-
128
- inject ( DestroyRef ) . onDestroy ( ( ) => {
129
- ref ?. destroy ( ) ;
123
+ onCleanup ( ( ) => void ref . destroy ( ) ) ;
130
124
} ) ;
131
125
}
132
126
You can’t perform that action at this time.
0 commit comments