MCPcopy Create free account
hub / github.com/firebase/quickstart-js / cleanupUi

Function cleanupUi

database/scripts/main.ts:519–532  ·  view source on GitHub ↗

* Cleanups the UI and removes all Firebase listeners.

()

Source from the content-addressed store, hash-verified

517 * Cleanups the UI and removes all Firebase listeners.
518 */
519function cleanupUi() {
520 // Remove all previously displayed posts.
521 topUserPostsSection.getElementsByClassName('posts-container')[0].innerHTML =
522 '';
523 recentPostsSection.getElementsByClassName('posts-container')[0].innerHTML =
524 '';
525 userPostsSection.getElementsByClassName('posts-container')[0].innerHTML = '';
526
527 // Stop all currently listening Firebase listeners.
528 listeningFirebaseRefs.forEach(function (ref) {
529 off(ref);
530 });
531 listeningFirebaseRefs = [];
532}
533
534/**
535 * The ID of the currently signed-in User. We keep track of this to detect Auth state change events that are just

Callers 1

onAuthChangedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected