1.2.0 • Published 5 years ago

@bytesoftio/helpers-promises v1.2.0

Weekly downloads
13
License
MIT
Repository
github
Last release
5 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

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago