Data APIs

createAsync

Edit this page

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));
Report an issue with this page