S
SolidJS4w 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
duk4w 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.