frameRefresh
Keeps the frame that renders the host current.
import { frameRefresh } from "@sdxc/ui/mixins";Usage
Reloads the host's enclosing frame every every milliseconds and whenever the on event
reaches the host. One reload runs at a time: an event during a reload queues one more. The
schedule pauses while the page is hidden and reloads once when it is shown again.
Signature
frameRefresh(options: FrameRefresh.Options): MixinDescriptor<Element>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | FrameRefresh.Options | Yes |
Examples
<section mix={[frameRefresh({ every: 30_000 })]}>…</section><div mix={[frameRefresh({ on: "app:saved", until: () => done })]}>…</div>Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/mixins too.
Interface
FrameRefresh.Options
Configuration for frameRefresh; give every, on, or both.
| Member | Type | Required | Description |
|---|---|---|---|
every | number | No | Milliseconds between the end of one reload and the start of the next. |
on | string | No | DOM event type that reloads the frame when it reaches the host, read once on insert. |
until | () => boolean | No | Read before each reload; once it answers true the host stops reloading the frame. |