Constructor
new CancellableEventEmitter(request)
Creates an instance.
Parameters:
| Name | Type | Description |
|---|---|---|
request |
object | An object that should expose an 'cancel()' method that accepts an optional reason (string). |
- Source:
Extends
- EventEmitter
Methods
cancel(reason)
Cancel the request. If a reason is provided, it will cause the
RequestCallback provided to the fetch() method
to be called with a RequestError as it single argument, containing
status 512 and this reason as its message.
Parameters:
| Name | Type | Description |
|---|---|---|
reason |
string | The reason for the cancellation. If omitted, the request will be cancelled or aborted silently. |
- Source: