react-pouchdb icon indicating copy to clipboard operation
react-pouchdb copied to clipboard

Merge use-pouchdb into react-pouchdb

Open Terreii opened this issue 5 years ago • 1 comments

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.

Terreii avatar Jul 16 '20 17:07 Terreii

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.

frontsideair avatar Sep 28 '20 10:09 frontsideair