exportclassPopupComponent{private_triggerPopup$=newSubject<any>();// typing aren't needed since TypeScript will get the type by parsing the codeisShowPopup$=this._triggerPopup$.pipe(switchMap(()=>timer(POPUP_TIMEOUT_DURATION).pipe(mapTo(false),startWith(true)// until the timer fires, you'll have this value)),);}
How about?
I don't know if this could be optimized further 😅
I've to admit that's prettier than mine! :)
It's a shame that this article didn't get more attention. I catch myself coming back to this particular comment time and time again :D