A simple JavaScript helper for adding a retry interval for rejected promises.