k3nsei/ng-in-viewport

How to debounce the event?

pranavkumar389 opened this issue · 1 comments

Please provide an example of debouncing the observer event.

You can do that on so many ways.

  1. Use viewCildren an subscribe to directive action output with debounce pipe.

  2. Create rxjs subject in your component and just use .next(event) method to pass down invewport event to it. Rest is same as in previous solution pipe with debounce and subscribe.

Those are some of possible solutions.