createAsync
Edit this pageInfo:
This is light wrapper over createResource
which serves as a stand-in for a future primitive being brought to Solid core
in 2.0.
An asynchronous primitive with a function that tracks similar to createMemo.
createAsync expects a promise back that is then turned into a Signal.
Reading it before it is ready causes Suspense/Transitions to trigger.
const user = createAsync(() => getUser(params.id));Info:
Using cache in createResource directly will not work since the fetcher is
not reactive. This means that it will not invalidate properly.