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 77 ElementRef ,
88 inject ,
99 input ,
10+ linkedSignal ,
1011 numberAttribute ,
1112 OnDestroy ,
1213 OnInit ,
@@ -98,26 +99,23 @@ export class ToastComponent implements OnInit, OnDestroy {
9899 */
99100 readonly visibleInput = input ( false , { transform : booleanAttribute , alias : 'visible' } ) ;
100101
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 ( ) ;
103109 } ) ;
104110
105111 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 ) ;
113113 }
114114
115- get visible ( ) {
116- return this . #visible;
115+ get visible ( ) : boolean {
116+ return this . #visible( ) ;
117117 }
118118
119- #visible = false ;
120-
121119 /**
122120 * @ignore
123121 */
You can’t perform that action at this time.
0 commit comments