[]previous and next page

Data fetching

Load, refetch, mutate and optimistically update server data with useResource and useOptimistic, and choose between resources and router loaders.

For agentsUpdated

After this page you can fetch data in a component, refetch it when an input changes, cancel stale requests, show loading and error UI, update the screen before the server answers, poll safely, and decide whether data belongs in a resource or in a router loader.

Use useResource for an asynchronous value owned by a component, or a router loader for data owned by a route. For a shared server-data cache, use @shadow-js/query. Dusk's server functions keep server-only work behind a typed call.