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

Strip down the Document property from the data itself?

binajmen opened this issue · comments

Is there a convenient way provided by this library that I'm not aware of to remove the additional fields (id, exists, hasPendingWrites, __snapshot) from a document?

I was thinking about:

const { id, exists, hasPendingWrites, __snapshot, ...rest } = data

That looks right!

Would it make sense to add a data() function similar to Firestore to automate this, or am I the only one to have this need?