voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
28 lines (16 loc) • 1.04 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[](./index.md) > [@firebase/database](./database.md) > [OnDisconnect](./database.ondisconnect.md) > [setWithPriority](./database.ondisconnect.setwithpriority.md)
Ensures the data at this location is set to the specified value and priority when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).
<b>Signature:</b>
```typescript
setWithPriority(value: unknown, priority: number | string | null): Promise<void>;
```
| Parameter | Type | Description |
| --- | --- | --- |
| value | unknown | The value to be written to this location on disconnect (can be an object, array, string, number, boolean, or null). |
| priority | number \| string \| null | The priority to be written (string, number, or null). |
<b>Returns:</b>
Promise<void>
Resolves when synchronization to the Database is complete.