Package Exports
- timeout-signal
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (timeout-signal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
timeout-signal 
Create an AbortSignal that aborts after a delay.
Install
npm install timeout-signal
Usage
const timeoutSignal = require("timeout-signal");
const fetch = require("cross-fetch");
fetch("https://www.google.com", { signal: timeoutSignal(5000) })
.then(response => {
// Handle response
})
.catch(error => {
if (error.message === "The user aborted a request.") {
// Handle abortion
}
})
API
timeoutSignal(timeout)
timeout
Type: integer
The milliseconds to wait.