qelp

Q promise helpers

qelp—Q helpers

Returns a promise that with method cancel which stops the callbacks from propagating.

This is useful if you attach a promise callback to change UI elements, but then the user decides they don't want to wait for the data to load, and instead loads another object in that promise's place.

  • promise — Promise to add ability to cancel

Promise with cancel({Boolean} allowSuccess, {Boolean} allowError) method


Tries to call the fn function multiple times in hopes that it will resolve. Calling an AJAX function may not resolve successfully the first time due to network issues, so this function will retry calling it.

  • fn — Function which creates a promise

A promise to the data we're retrying to resolve.