<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/database](./database.md) &gt; [OnDisconnect](./database.ondisconnect.md) &gt; [cancel](./database.ondisconnect.cancel.md)

## OnDisconnect.cancel() method

Cancels all previously queued `onDisconnect()` set or update events for this location and all children.

If a write has been queued for this location via a `set()` or `update()` at a parent location, the write at this location will be canceled, though writes to sibling locations will still occur.

<b>Signature:</b>

```typescript
cancel(): Promise<void>;
```
<b>Returns:</b>

Promise&lt;void&gt;

Resolves when synchronization to the server is complete.

