🪴 notes

Search

Search IconIcon to open search

firebase withConverter

Published May 5, 2023 Last updated May 5, 2023 Edit Source

I’m trying to get correct types when I get data from firebase.

withConverter docs

Problem:

1
2
type User = {uid: string, ...}
let user = fb.collection().data().get().data() as User;

I can do this without errors even though actual data is missing uid. This should not happen. zod might help here.