← Back to patterns

Manual refresh

Calling .refresh() method on demand

Pattern Usage:

let timeQuery = getDelayedTime({ delay: 1000 });

async function handleRefresh() {
  await timeQuery.refresh();
}

Live Demo:

Refreshed 0 times

How it works: The query is called once on mount. You can manually trigger a refresh by calling .refresh() method. This is useful for "Reload" buttons or polling intervals. The button is disabled during loading to prevent duplicate requests.