Regular Solid - the Correct way to use createResource?
In my app, on my Dashboard view, I am using
createResource
to get my user data.
I'm then just updating another user signal with data returned from the createResource
. I'm doing this because this user signal is used through out the app... so when it's populated the correct data is displayed.
But this has me thinking... why not just use regular fetch
in an onMount
to get the data and update the user signal.
What is the correct way to use createResource
?
You don't want to have an "instance" of createResource
all over your app do you? That doesn't make sense to me.4 Replies
You don't want to have an "instance" of createResource all over your app do you? That doesn't make sense to me.why not? it's a signal + added capabilities for async (suspense, transitions).
https://www.youtube.com/watch?v=oQ1zn7cdtyU&t=13s is a nice talk about suspense, transitions and how resources play a part in that
Future Frontend
YouTube
Ryan Carniato - SolidJS: Why all the Suspense?
In this talk Ryan discusses SolidJS and its relationship with React's Suspense.
Slides: https://docs.google.com/presentation/d/1NoJtBdpf13noV-4MebYMZkhJhWn4Y79-7f00SlSCAmc
I don't know why not... yet. Thanks I'll watch this tonight for sure. I appreciate it
ur welcome!