Skip to content

Instantly share code, notes, and snippets.

@abinavseelan
Created December 14, 2017 18:48
Show Gist options
  • Select an option

  • Save abinavseelan/4fa46a01e07417c58f47ef14dafd575a to your computer and use it in GitHub Desktop.

Select an option

Save abinavseelan/4fa46a01e07417c58f47ef14dafd575a to your computer and use it in GitHub Desktop.
onDisconnect() Firebase Real Time Database example
const oldRealTimeDb = firebase.database();
oldRealTimeDb
.ref('/some/random/key') // Making a reference to a key-value pair in the old real-time database structure
.onDisconnect() // Setting up the onDisconnect hook
.set('This string will be set for the referenced key once the client disconnects!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment