Skip to content

Commit

Permalink
feat: remove useCountFromServer (#248)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `useCountFromServer` was removed in favor of
`useAggregateFromServer`
  • Loading branch information
andipaetzold committed Oct 12, 2023
1 parent d8b9d90 commit f2724ed
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 46 deletions.
18 changes: 0 additions & 18 deletions docs/firestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,6 @@ Returns:
- `loading`: `true` while calculating the aggregate; `false` if the aggregate was calculated successfully or an error occurred
- `error`: `undefined` if no error occurred

## useCountFromServer

Returns the number of documents in the result set of of a Firestore Query. Does not update the count once initially calculated.

```javascript
const [count, loading, error] = useCountFromServer(query);
```

Params:

- `query`: Firestore query whose result set size is calculated

Returns:

- `value`: Size of the result set; `undefined` if the result set size is currently being calculated, or an error occurred
- `loading`: `true` while calculating the result size set; `false` if the result size set was calculated successfully or an error occurred
- `error`: `undefined` if no error occurred

## useDocument

Returns and updates a DocumentSnapshot of a Firestore DocumentReference
Expand Down
8 changes: 8 additions & 0 deletions migrations/v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
## Peer dependency

This library now requires firebase 10.5.0 or later

## Firestore

- `useCountFromServer` # Migrate from v3 to v4

## Peer dependency

This library now requires firebase 10.5.0 or later
1 change: 0 additions & 1 deletion src/firestore/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from "./types.js";
export * from "./useAggregateFromServer.js";
export * from "./useCountFromServer.js";
export * from "./useDocument.js";
export * from "./useDocumentData.js";
export * from "./useDocumentDataOnce.js";
Expand Down
27 changes: 0 additions & 27 deletions src/firestore/useCountFromServer.ts

This file was deleted.

0 comments on commit f2724ed

Please sign in to comment.