@proficient/util
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

@proficient/util

High-quality and essential TypeScript utilities


Proficient is released under the MIT license. PRs welcome!

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.

Package Sidebar

Install

npm i @proficient/util

Weekly Downloads

1,519

Version

0.2.2

License

MIT

Unpacked Size

16.9 kB

Total Files

18

Last publish

Collaborators

  • anarkafkas