0.2.2 • Published 2 years ago

@proficient/util v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

View the full documentation (docs) ▸

Overview

  1. Installation
  2. API
  3. Upgrading
  4. License

Installation

# npm
npm install -E @proficient/util

# yarn
yarn add -E @proficient/util

API

makeRetriable

Creates a retriable version of a given function, which, when invoked, is continuously retried according to the specified retry config until it succeeds. The new function returns a Promise that resolves when the original function succeeds or maxTrialCount is reached.

registerInterval

Registers an async callback that keeps running in the background until it is unregistered. Waits for the callback Promise to resolve and sleeps for an additional duration ms and invokes the callback again.

sleep

Sleeps for a specified number of milliseconds.

Upgrading

Until we release v1, there may be breaking changes between minor versions (e.g. when upgrading from 0.2 to 0.3). However, all breaking changes will be documented and you can always use our Releases page as a changelog.

License

This project is made available under the MIT License.