Skip to content
tsdotnetPublic

About

An extended A+ promise library with lazy and synchronous promises.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

@tsdotnet/promises: Promises, your way. Synchronous-capable and lazy options.

npm version GitHub license

Promise implementations that can resolve synchronously or lazily: TSDNPromise, LazyPromise and promise collections.

Install

npm install @tsdotnet/promises

Usage

import { TSDNPromise } from '@tsdotnet/promises';

const total = TSDNPromise
	.all(TSDNPromise.resolve(1), TSDNPromise.resolve(2))
	.thenSynchronous(([a, b]) => a + b); // a promise of 3

thenSynchronous skips the extra tick when the value is ready. LazyPromise defers its work until something asks for the result.

Use it from

ESM (import { TSDNPromise, LazyPromise } from '@tsdotnet/promises';) or CommonJS (const { TSDNPromise, LazyPromise } = require('@tsdotnet/promises');). No <script> (UMD) build: use it with a bundler or Node.js.

Docs

tsdotnet.github.io/promises

About

An extended A+ promise library with lazy and synchronous promises.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages