import React from 'react' ; import firebase from 'firebase/app' ; import 'firebase/firestore' ; /**
 * Firestore connectivity.  Undefined by default when we don't know the status.
 */ export type FirestoreConnectivity = 'connected' | 'disconnected' ; export function useFirestoreConnectivity ( ) { const [ connectivity , setConnectivity ] = React . useState < FirestoreConnectivity | undefined > ( undefined ) ; const connectedRef = firebase . database ( ) . ref ( ".info/connected" ) ; return connectivity ; }