File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
projects/coreui-angular/src/lib/toast/toast Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 7
7
ElementRef ,
8
8
inject ,
9
9
input ,
10
+ linkedSignal ,
10
11
numberAttribute ,
11
12
OnDestroy ,
12
13
OnInit ,
@@ -98,26 +99,23 @@ export class ToastComponent implements OnInit, OnDestroy {
98
99
*/
99
100
readonly visibleInput = input ( false , { transform : booleanAttribute , alias : 'visible' } ) ;
100
101
101
- readonly #visibleInputEffect = effect ( ( ) => {
102
- this . visible = this . visibleInput ( ) ;
102
+ readonly #visible = linkedSignal ( this . visibleInput ) ;
103
+
104
+ readonly #visibleEffect = effect ( ( ) => {
105
+ const newValue = this . #visible( ) ;
106
+ newValue ? this . setTimer ( ) : this . clearTimer ( ) ;
107
+ this . visibleChange ?. emit ( newValue ) ;
108
+ this . changeDetectorRef . markForCheck ( ) ;
103
109
} ) ;
104
110
105
111
set visible ( value : boolean ) {
106
- const newValue = value ;
107
- if ( this . #visible !== newValue ) {
108
- this . #visible = newValue ;
109
- newValue ? this . setTimer ( ) : this . clearTimer ( ) ;
110
- this . visibleChange ?. emit ( newValue ) ;
111
- this . changeDetectorRef . markForCheck ( ) ;
112
- }
112
+ this . #visible. set ( value ) ;
113
113
}
114
114
115
- get visible ( ) {
116
- return this . #visible;
115
+ get visible ( ) : boolean {
116
+ return this . #visible( ) ;
117
117
}
118
118
119
- #visible = false ;
120
-
121
119
/**
122
120
* @ignore
123
121
*/
You can’t perform that action at this time.
0 commit comments