SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

frameRefresh

Keeps the frame that renders the host current.

tsx
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

typescript
frameRefresh(options: FrameRefresh.Options): MixinDescriptor<Element>

Parameters

ParameterTypeRequiredDescription
optionsFrameRefresh.OptionsYes

Examples

tsx
<section mix={[frameRefresh({ every: 30_000 })]}>…</section>
tsx
<div mix={[frameRefresh({ on: "app:saved", until: () => done })]}>…</div>

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.

MemberTypeRequiredDescription
everynumberNoMilliseconds between the end of one reload and the start of the next.
onstringNoDOM event type that reloads the frame when it reaches the host, read once on insert.
until() => booleanNoRead before each reload; once it answers true the host stops reloading the frame.
@sdxc/ui

Can’t find it? Contact us