useCaptureReady
Hold the capture shutter until this island's pixels are real.
Hold the capture shutter until this island’s pixels are real.
An island that keeps painting after mount — a map engine loading tiles, an
async decode — calls this hook and invokes the returned ready when its
last pixel is painted (map.once("idle", ready) is the map-engine shape).
Calling the hook takes a hold for this island instance at mount; ready is
identity-stable and idempotent, an unmounted island releases automatically,
and a branch with nothing to draw calls ready() immediately. An island
that paints everything during mount needs none of this — never calling the
hook is the default contract.
Where nothing captures (an editor canvas, a published website) the hold is never read, so the hook costs nothing there.
Import from @homepages/template-kit.
Signature
Section titled “Signature”function useCaptureReady(): () => voidReturns
Section titled “Returns”() => void