Promises extended

Usage no npm install needed!

<script type="module">
  import 0x2e757PromiseExt from 'https://cdn.skypack.dev/@0x2e757/promise-ext';



Native promise (ES2018) lightweight wrapper that can be cancelled. TypeScript code transpiled to ES2018 JavaScript.


npm i @0x2e757/promise-ext


New class PromiseExt mostly will by used same as regular ES2018 Promise.

How to import

import PromiseExt from "@0x2e757/promise-ext";

Unique methods

timeout — wrapper around resolver using setTimeout;

cancel — function for preventing promise or its chain actions execution;

Unique static functions

wrap — creates wrapper for provided promise;

* all function will cancel all cancellable promises if any of them will fail.