<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [FetchAndSaveHooks](./x-components.fetchandsavehooks.md) &gt; [onCancel](./x-components.fetchandsavehooks.oncancel.md)

## FetchAndSaveHooks.onCancel property

Synchronous callback executed when the request is cancelled. This can happen mainly for two reasons: - The [FetchAndSaveActions.cancelPrevious](./x-components.fetchandsaveactions.cancelprevious.md) action is dispatched. - A new [FetchAndSaveActions.fetchAndSave](./x-components.fetchandsaveactions.fetchandsave.md) is dispatched before the previous one was resolved.

**Signature:**

```typescript
onCancel?: () => void;
```
