• Version 0.1.1
  • Published
  • 1 dependency
  • BSD-3-Clause license


npm i cancel-token
yarn add cancel-token
pnpm add cancel-token


Implementation of



function isCancel

isCancel: (value: any) => value is Cancel;

    function isCancelToken

    isCancelToken: (value: any) => value is CancelToken;


      class Cancel

      class Cancel {}


        constructor(reason?: any);

          property message

          message: string;

            method toString

            toString: () => string;

              class CancelToken

              class CancelToken {}
              • A polyfill for the November 23rd, 2016 draft of


              constructor(executor: (cancel: CancelFunction) => void);

                property [Symbol.toStringTag]

                readonly [Symbol.toStringTag]: string;

                  property promise

                  promise: Promise<Cancel>;

                    property reason

                    reason: Cancel;

                      method race

                      static race: (tokens: Iterable<CancelToken>) => CancelToken;

                        method source

                        static source: () => { token: CancelToken; cancel: CancelFunction };

                          method throwIfRequested

                          throwIfRequested: () => void;

                            Type Aliases

                            type CancelFunction

                            type CancelFunction = (reason?: any) => void;
                            • Copyright (c) 2016 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at The complete set of authors may be found at The complete set of contributors may be found at Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at

                            Package Files (1)

                            Dependencies (1)

                            Dev Dependencies (7)

                            Peer Dependencies (0)

                            No peer dependencies.


                            To add a badge like this badgeto your package's README, use the codes available below.

                            You may also use to create a custom badge linking to

                            • Markdown
                            • HTML
                              <a href=""><img src="" alt=""></a>