From 8ed3c9017c7553d8b0905f5d64eec94a4eb6a23d Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Mon, 19 Oct 2026 18:25:47 -0400 Subject: [PATCH] Document readingTime in the widget toolbox --- src/content/docs/docs/create-a-widget/widget-page.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/docs/docs/create-a-widget/widget-page.md b/src/content/docs/docs/create-a-widget/widget-page.md index f0d6079..fb806ce 100644 --- a/src/content/docs/docs/create-a-widget/widget-page.md +++ b/src/content/docs/docs/create-a-widget/widget-page.md @@ -90,6 +90,7 @@ import { poll, fetchData, sparkline } from '/js/widget-toolbox.js?v=1'; - `widgetId()` returns this widget id from the frame URL. - `fetchData(endpoint?, { params })` fetches `/api/widget-data/` and returns the parsed JSON. Throws on a non-OK response. Each name in `params` must be listed in the manifest's [`params`](/docs/create-a-widget/manifest/#query-parameters). +- `readingTime(data)` returns when the service produced data that `fetchData` returned. While a slow refresh runs, the server can answer with the previous result, so use this, not `Date.now()`, for an "updated" label. - `getConfig()` fetches this widget config, without secrets. ### Polling