← Back to patterns
Direct .current access
Accessing query().current property in script
Pattern Usage:
let timeQuery = getDelayedTime({ delay: 1500 });
// Access properties:
// timeQuery.current - the data (or undefined if loading)
// timeQuery.loading - boolean loading state
// timeQuery.error - error object (or undefined)
Live Demo:
How it works: The query returns an object with reactive properties. You
access .current
for the data, .loading
for loading state, and .error
for errors. This gives you more control over the UI than {#await}.