react-pouchdb
react-pouchdb copied to clipboard
Merge use-pouchdb into react-pouchdb
When I created usePouchDB I missed that react-pouchdb also have hooks. Because there is no point in doing the same work twice I propose "merging" functionality from usePouchDB into react-pouchdb.
I created this issue, so that it can serve as the general discussion place for the merging/re-implementing.
Hooks present in usePouchDB
- useAllDocs - for
db.allDocs() - useView - for
db.query()(Map/reduce indexes)
Additionally functionality
useFind in usePouchDB has an index field that excepts the object from db.createIndex()'s index field. The hook will then call db.createIndex(). And then db.find() with the index's ID and name from the result of createIndex.
I fully support this! I like this library because of the Suspense support and usePouchDB for TS support and query. Having both would be wonderful.