How to handle initial undefined state

Hey guys! I need some help on something that is probably trivial to a lot of you. I am using the useLiveQuery hook to get and then display data on a screen in my app (it's a todo app and i'm essentially getting the list data to be able to display) . The problem is that whenever I want to access said data, I ALWAYS have to use the optional selector to handle the initial undefined state. So my code is FILLED with a whole bunch of ? marks... How do you guys avoid having to do this?? I've used React Query before and the nice thing with them is that their useQuery hook returns a loading state that I can use to handle the initial undefined state of data and then display it, but I don't have that kind of feature with Drizzle. Any help would be appreciated, I've been on this "issue" for days now and I can't find any docs or help about it online.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?