Arcane OS Docs Development only

Reference

Arcane.events.completed()

Synchronously reports whether this document has stored the designated durable completion.

  • Reference

This focused page is derived from the mechanically checked full member inventory.

Syntax

Arcane.events.completed(eventName)

Parameters

eventName: "transport.ready" or "core.ready"

Return value

boolean

Description

Synchronously reports whether this document has stored the designated durable completion.

Overview

Arcane.events.completed(eventName) synchronously reports whether this document has already observed the first occurrence of a designated durable completion. It returns true only for an observed transport.ready or core.ready event.

It returns false for a durable event that has not occurred, for an ordinary event, and for an unknown name. It does not throw for an unknown name and does not initiate transport or host work. Use when() to act when the completion is available instead of polling this method.

The Arcane event catalog distinguishes durable completions from future-only events.

Parameters and return value

Parameter Type Description
eventName string The completion name to inspect.

The return value is a synchronous boolean.

Example

const events = globalThis.Arcane?.events;

if (!events?.completed || !events?.when) {
    throw new Error('Arcane completion events are unavailable.');
}

if (events.completed('core.ready')) {
    console.log('Core readiness was already observed in this document.');
} else {
    const stopWaiting = events.when('core.ready', function reportCoreReady(payload) {
        console.log('Core became ready', payload.version);
    });

    globalThis.addEventListener('pagehide', stopWaiting, {once: true});
}

Reference group

Core and events

Repository and reviewed source access