1.1.2 • Published 9 months ago

managed-status-promise v1.1.2

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
9 months ago

Extended Promise

This library provides an extended Promise with status management

Usage

import { ExtendedPromise, PromiseStatus } from 'managed-status-promise';

/**
 * @README the internal promise will always resolve
 * for a rejecting promise you can use the ExtendedPromise itself since it implements `PromiseLike`
 * Additionally, the extended promise class extends EventTarget and emits a `changed` event for status changes
 */
const promise = new ExtendedPromise((resolve, reject) => {
  reject(new Error('Error'))
});
expect(promise.status).toBe(PromiseStatus.FAILED);
1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago