@bytesoftio/helpers-promises
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@bytesoftio/helpers-promises

Installation

yarn add @bytesoftio/helpers-promises or npm install @bytesoftio/helpers-promises

Table of contents

Description

A collection of promises related helpers.

createTimeout

A promisified verion of the setTimeout function.

import { createTimeout } from "@bytesoftio/helpers-promises"

await createTimeout(2000)

createPromise

Create a promise that you can pass around without specifying the resolve function first.

import { createPromise } from "@bytesoftio/helpers-promises"

const promise = createPromise()

// pass promise to another function
runWhenResolved(promise)

promise.resolve("your data")
// or
promise.reject("reason...")

Readme

Keywords

none

Package Sidebar

Install

npm i @bytesoftio/helpers-promises

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

7.15 kB

Total Files

12

Last publish

Collaborators

  • maximkott