Skip to content
easy-cancelable-promise
Documentation

Small API.
Clear mental model.

Start with one promise you can cancel. Add progress, groups and deferred promises as your application grows.

The mental model
01 / 03
task.ts
const task = new CancelablePromise((resolve, reject, { onCancel }) => {
  onCancel(() => stopTheWork());
});

task.cancel();
cancel()
onCancel(…)

Whoever holds the promise cancels it.
The promise stops its own work.

Find your way

A guide for every layer.

See it run before you read.

Three live examples, each with its tested source.

↑↓ Navigate ↵ Open Esc Closeeasy-cancelable-promise docs
Get started

Promises you can actually control.