Skip to content

Instantly share code, notes, and snippets.

@mateuszgachowski
Last active September 16, 2018 09:16
Show Gist options
  • Select an option

  • Save mateuszgachowski/504cc3ce64a6f32c669a1f61cd77474c to your computer and use it in GitHub Desktop.

Select an option

Save mateuszgachowski/504cc3ce64a6f32c669a1f61cd77474c to your computer and use it in GitHub Desktop.
Small lib for making smart requests
// The problem
// @syntax
// ask(URL:String, OPTIONS:Object);
const asked = ask('https://myapi.com/v2/rest/issues', {
interval: 1000,
failFactor: function (interval, errorCount) {
return interval * errorCount;
},
onError: function () {},
onSuccess: function () {},
onAll: function () {},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment