SolidJSS
SolidJSโ€ข3y agoโ€ข
4 replies
danboyle8637

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.
Was this page helpful?