Added flexibility with `retryDelay` and `onRetry` as functions
The new version adds support for specifying retryDelay and onRetry as functions, while staying backwards compatible.
This makes the library more flexible, and adds the possibility for users to implement exponential back-off instead of using a static retry interval. It also allows users to add custom logic on when to retry requests, or perform additional actions before a retry (for instance logging on retry attempts).
Many thanks to @thomsbg for making this release possible by contributing pull requests.