By calling keepSynced(true) on a location, the data for that location will automatically be downloaded and kept in sync, even when no listeners are attached for that location.
keepSynced(true)
const dbRef = ref(getDatabase(), 'users');await keepSynced(dbRef, true); Copy
const dbRef = ref(getDatabase(), 'users');await keepSynced(dbRef, true);
A location to keep synchronized.
Pass true to keep this location synchronized, pass false to stop synchronization.
true
false
By calling
keepSynced(true)on a location, the data for that location will automatically be downloaded and kept in sync, even when no listeners are attached for that location.Example