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). #138

Closed jckw closed 2 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.


Note: This is a clean branch of https://github.com/nandorojo/swr-firestore/pull/123

Closes https://github.com/nandorojo/swr-firestore/pull/123

jckw commented 3 years ago

Carrying on from the previous PR: We've been using this code in production for a number of months now without a problem.