Add delay functionality to `app/assets/javascripts/lib/utils/poll.js` utility
Summary
There is a use case for starting a poll after an initial API request. Since onMakeRequest
calls the polling API request immediately, the first request is unlikely to be useful as the initial data was just retrieved.
This discussion first started here with the polling for notes
happening very shortly after the initial request, which is unnecessary so soon after the initial request. Ideally, one would be able to postpone the polling from starting until some reasonable time later (i.e. whatever the polling interval is)
Improvements
If there was an option to delay the polling start for the polling interval duration, then there would be a one less API request
Risks
Technically there could be new data between the request of the initial information and the start of the polling, but since the polling happens at a short enough interval, it will be remedied in several seconds
Involved components
app/assets/javascripts/lib/utils/poll.js