Skip to content

Commit

Permalink
- Update CHANGELOG and examples in README
Browse files Browse the repository at this point in the history
- Bump version to 0.6.0
  • Loading branch information
premshree committed Dec 21, 2021
1 parent 7a849b2 commit c492f35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.6.0
- 0.6.0 supports Firebase 9.x and is NOT backwards compatible with earlier major versions of Firebase. Thanks @rrnara

# 0.5.0

- Add ability to have query or limit controlled by external state (thanks @matziol)
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This hook is similar, but the not the same as
provides _non cumulative_ pagination and does _not_ maintain references to previous
documents, so it might be suitable for large document sets.

## Support for Firebase 9

Versions 0.6.x add support for Firebase 9 and are backwards _incompatible_ with previous versions of Firebase. For support for Firebase 8.x, use versions 5.x of `use-pagination-firestore`.

## Install

```
Expand All @@ -22,14 +26,18 @@ and [Firestore](https://firebase.google.com/docs/firestore/). You can see it liv
import React from 'react';
import Grid from "@material-ui/core/Grid";
import PerfumeCard from "./search/PerfumeCard";
import {usePagination} from "use-pagination-firestore";
import { usePagination } from "use-pagination-firestore";
import Loading from "./Loading";
import {
NavigateNext as NavgateNextIcon,
NavigateBefore as NavigateBeforeIcon
} from '@material-ui/icons';
import {IconButton} from "@material-ui/core";
import firebase from "firebase/app";
import { IconButton } from "@material-ui/core";
import { initializeApp } from "firebase/app";
import { getFirestore, collection, query, orderBy } from "firebase/firestore";

const firebaseApp = initializeApp(firebaseConfig);
const db = getFirestore(firebaseApp);

const RecentPerfumes = () => {
const {
Expand All @@ -40,10 +48,7 @@ const RecentPerfumes = () => {
getPrev,
getNext,
} = usePagination<Perfume>(
firebase
.firestore()
.collection("/perfumes")
.orderBy("updated", "desc"),
query(collection(db, "/perfumes"), orderBy("updated", "desc")),
{
limit: 10
}
Expand Down Expand Up @@ -99,10 +104,7 @@ const RecentPerfumes = () => {
getPrev,
getNext,
} = usePagination<Perfume>(
firebase
.firestore()
.collection("/perfumes")
.orderBy("updated", order),
query(collection(db, "/perfumes"), orderBy("updated", "desc")),
{
limit: pageSize
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-pagination-firestore",
"version": "0.5.1",
"version": "0.6.0",
"description": "A non-cumulative pagination hook for use with Firestore",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down

0 comments on commit c492f35

Please sign in to comment.