nandorojo / swr-firestore

Implement Vercel's useSWR for querying Firestore in React/React Native/Expo apps. πŸ‘©β€πŸš’πŸ”₯
MIT License
777 stars 65 forks source link

feat: Get id(s) from created document(s). #123

Closed jckw closed 3 years ago

jckw commented 3 years ago

On adding to a collection, the document ID is returned when a single object is passed, and the set of document IDs is returned when multiple objects are passed as an array.

Fixes #62.

nandorojo commented 3 years ago

@jckw can you confirm this is working on prod? I’m not really in a position to test it, but could merge if it’s safe to

jckw commented 3 years ago

The change does work, but I've messed around with the branch a bit. I'll isolate the change and put up a new PR which we can merge tomorrow AM.

jckw commented 3 years ago

New PR up here: https://github.com/nandorojo/swr-firestore/pull/138