<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [lite](./firestore_lite.md) &gt; [terminate](./firestore_lite.terminate.md)

## terminate() function

Terminates the provided Firestore instance.

After calling `terminate()` only the `clearIndexedDbPersistence()` functions may be used. Any other function will throw a `FirestoreError`<!-- -->. Termination does not cancel any pending writes, and any promises that are awaiting a response from the server will not be resolved.

To restart after termination, create a new instance of FirebaseFirestore with [getFirestore()](./firestore_.getfirestore.md)<!-- -->.

Note: Under normal circumstances, calling `terminate()` is not required. This function is useful only when you want to force this instance to release all of its resources or in combination with [clearIndexedDbPersistence()](./firestore_.clearindexeddbpersistence.md) to ensure that all local state is destroyed between test runs.

<b>Signature:</b>

```typescript
export declare function terminate(firestore: FirebaseFirestore): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  firestore | [FirebaseFirestore](./firestore_lite.firebasefirestore.md) | The Firestore instance to terminate. |

<b>Returns:</b>

Promise&lt;void&gt;

A promise that is resolved when the instance has been successfully terminated.

