Is there a way to skip the createResource query until a parameter is available?
Something similar to Tanstack Query or Apollo, maybe?
3 Replies
I'll probably just install TanStack haha
If you return falsy from source, it will not run until it is truthy
From: https://docs.solidjs.com/reference/basic-reactivity/create-resource.
or you can additionally pass a source signal as the first argumentBasically feed the parameter through a signal.
as was already mentioned previously.fetchData
will be called as soon assource
has any value other thanfalse
,null
, orundefined
.