quodolores
Version:
Monorepo for the Firebase JavaScript SDK
27 lines (15 loc) • 970 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [/](./firestore_.md) > [disableNetwork](./firestore_.disablenetwork.md)
## disableNetwork() function
Disables network usage for this instance. It can be re-enabled via [enableNetwork()](./firestore_.enablenetwork.md)<!-- -->. 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.
<b>Signature:</b>
```typescript
export declare function disableNetwork(firestore: FirebaseFirestore): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| firestore | [FirebaseFirestore](./firestore_.firebasefirestore.md) | |
<b>Returns:</b>
Promise<void>
A promise that is resolved once the network has been disabled.