S
SolidJS7mo ago
Luka

How to handle Loading/Error

I am making calls to server using createAsync it is returning a signal, how should I handle a loading and error states. what is the best practice, and also documentation says that it has these states as properties just like createResourse had but I can't access it.
1 Reply
duk
duk7mo ago
if you are using createAsync (I suppose with cache) you should use Suspense and ErrorBoundary to handle loading and error states, because createAsync only turns a Promise into a Signal, it doesn't offer the ResourceReturn type like createResource.
Want results from more Discord servers?
Add your server