createMemo accessor null value
I have the following code to access a Firebase collection and it depends on a user's UID which gets loaded after the page load:
I have
a
as a placeholder because I can't return null
from createMemo
. right now what happens is before state.data
is populated by solid-firebase
, the docComputed
value has the dummy value a
which doesn't exist in the database. I am wondering if it is possible to make it so that todos
is also null or has some indication that it is still loading while the user auth is loading rather than trying to access the nonexistent dummy collection a
. here is the relevant source code for solid-firebase
for reference: https://github.com/wobsoriano/solid-firebase/tree/main/src/hooks1 Reply
Is there a reason why you can't use separate signals for that? I'm thinking, since
useFirestore
can have a nullable initial value, you could create an isLoading
signal which can be set to true until state.data?.uid
is loaded: