0.0.5 • Published 2 years ago

stop-promise v0.0.5

Weekly downloads
6
License
ISC
Repository
github
Last release
2 years ago

cancellable-promise

installation

$ npm i stop-promise -D

import

import cancellablePromise from "stop-promise";

make your promise cancellable

Import stop-promise module.

import cancellablePromise from "stop-promise";

Import your service or other class with promise(s).

import MyService from "services/your-service";

Make your promise cancellable.

const { promise, cancel } = cancellablePromise(MyService.findItems());

Play with your promise as usually:

promise
  .then((response) => console.log("Success!", response))
  .catch((error) => console.error("Failed...", error));

Cancel your promise when you want by calling cancel callback.

cancel();
0.0.5

2 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.1

4 years ago