How to use the p-cancelable.CancelError function in p-cancelable

To help you get started, we’ve selected a few p-cancelable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinajs / wxio / src / apis / request.js View on Github external
return queue.add(() => {
    if (isCanceled) {
      return Promise.reject(new CancelError())
    }
    job = request(options)
    if (options.timeout) {
      job = timeout(job, options.timeout)
    }
    return job
  })
})

p-cancelable

Create a promise that can be canceled

MIT
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis

Popular p-cancelable functions