The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/firestore > / > disableNetwork

disableNetwork() function

Disables network usage for this instance. It can be re-enabled via enableNetwork(). While the network is disabled, any snapshot listeners, getDoc() or getDocs() calls will return results from cache, and any write operations will be queued until the network is restored.

Signature:

export declare function disableNetwork(firestore: FirebaseFirestore): Promise<void>;

Parameters

Parameter Type Description
firestore FirebaseFirestore

Returns:

Promise<void>

A promise that is resolved once the network has been disabled.