nandorojo / swr-firestore

Implement Vercel's useSWR for querying Firestore in React/React Native/Expo apps. 👩‍🚒🔥

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for custom ID with new documents / offline support

myktra opened this issue · comments

Is it possible to enhance the add(data) function returned by the useCollection hook to allow the client/caller to supply their own sufficiently unique/predictable ID for new documents, for example via the nanoid library? Currently this implementation seems to require standard Firestore library/server-generated IDs.

const add = useCallback(

Ultimately looking for offline support for new documents as noted in issue #56 and PR #55. This would be a killer feature!!!