1.2.0 • Published 4 years ago

@bytesoftio/helpers-promises v1.2.0

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

@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...")
1.2.0

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago