# Aborting Fetch

[AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) provides a new way of cancelling
fetches that are no longer considered relevant. This can be hooked into fetch via the second `RequestInit` parameter.

## Resource

Easy integration is provided with the [RestEndpoint](https://dataclient.io/rest/api/RestEndpoint.md) via the signal member:

```typescript
const abort = new AbortController();
const AbortableArticle = CoolerArticleResource.get.extend({
  signal: abort.signal,
});
// ...somewhere later trigger cancellation
abort.abort();
```

## Endpoint

Any [Endpoint](https://dataclient.io/rest/api/Endpoint.md#signal) takes a `signal` member the same way: read
`this.signal` in its fetch function.
