Skip to content

pedromsilvapt/data-cancel-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cancel Token

Simple TypeScript/ES2015 class to emulate cancellation tokens. Does not fully comply yet with the proposed specification.

Installation

npm install --save data-cancel-token

Usage

import { CancelToken } from 'data-cancel-token';

const token = new CancelToken();

console.log( token.cancellationRequested );

token.cancellationPromise.then( () => console.log( 'cancelled' ) );

token.throwIfCancellationRequested();

token.cancel();

About

Simple TypeScript/ES2015 class to emulate cancellation tokens

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published