akserg / ng2-slim-loading-bar

Angular 2 component shows slim loading bar at the top of the page.
MIT License
358 stars 93 forks source link

Refactor setInterval to Observable.interval #63

Open ghost opened 6 years ago

ghost commented 6 years ago

I'm submitting a ... (check one with "x")

[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[x] feature request

Current behavior Intervals are executed using setInterval().

Expected/desired behavior Intervals use RxJS Observable.interval().

What is the motivation / use case for changing the behavior? It's best practice. Also, Subscription is a more "Angular way" and can be used to terminate the interval.