#Maybe Observable with Hostlisteners

4 messages · Page 1 of 1 (latest)

neat abyss
#

Hi all,

I have a directive with 2 Hostlisteners one for mouse enter and another for mouse leave events and I am setting and resetting some transition in the respective function but it's causing a jitter affects (as my animations are such that it is causing multiple mouse enter and leave events)

Is there a way I can make that directive to execute one Hostlisteners function at a time and ignore other one until the function associated with first event is not executed completely.

wooden mesa
#

mouseEnter$.pipe(
exhaustMap(() => mouseLeave$)
)

#

Would ignore further mouse enters until there is a mouse leave

#

(which you can do by making them ReplaySubjects and have the host listeners next() them)