k3nsei/ng-in-viewport

Trigger event after it's 100% in the viewport for time `t`

radiumrasheed opened this issue · 2 comments

how about if I need it to trigger after being in the viewport for a particular time.

the use case is to mark a message as read after 10 seconds

@k3nsei any help

Just run some timer when your message would be visible, then when it stops being visible clear that timer.
If you want to track many messages then use some Map with message ids as a keys to track timers.

thanks @k3nsei , that's helpful