onDisconnect
Manage presence by writing or deleting data when the client disconnects.
Usage
Typical use is to update presence information when a user goes offline.
Example
import { db } from 'refirebase';
// Set online status
await db.realtime.set('presence/uid', true);
// Remove data when client disconnects
db.realtime.onDisconnect('presence/uid').remove();Parameters
| Param | Type | Description |
|---|---|---|
path* | string | The path to the data. |
Return value
Returns
ObjectAn object containing `set`, `update`, `remove`, and `cancel` methods.