jquerypoll

1.0.5 • Public • Published

$.poll

Allows you to poll an AJAX call until your pre-defined condition is met. Ideal for displaying a spinner until an action is complete.

Build

Build Status

API

/*
url: Points to the GET endpoint from where to poll
interval_in_milliseconds: Interval between calls to the url
terminator_callback: A callback function that returns true to indicate end of polling
*/
$.poll(urlToPoll, intervalInMilliseconds, terminatorCallback)
$.poll('http://my/url', 100, (xhr, status, data) => {
    return data.hello === 'world';
})

Package Sidebar

Install

npm i jquerypoll

Weekly Downloads

4

Version

1.0.5

License

MIT

Unpacked Size

2.08 kB

Total Files

3

Last publish

Collaborators

  • smsohan