effex-monorepo
    Preparing search index...

    Interface SuspenseOptions<E, R1, RF, RC>

    Options for the suspense boundary (DOM-specialized version).

    interface SuspenseOptions<E, R1, RF, RC> {
        catch?: (error: E) => Element<DOMElement, never, RC>;
        delay?: DurationInput;
        fallback: () => Element<DOMElement, never, RF>;
        render: () => Element<DOMElement, E, R1>;
    }

    Type Parameters

    • E
    • R1
    • RF
    • RC
    Index

    Properties

    catch?: (error: E) => Element<DOMElement, never, RC>

    Optional error handler. If provided, errors from render are caught and this function is called to render an error state. Must have no requirements.

    delay?: DurationInput

    Delay before showing the fallback. If the render completes before this duration, no fallback is shown. Accepts Effect Duration strings like "200 millis", "1 second", or a number (milliseconds). If not provided, fallback is shown immediately.

    fallback: () => Element<DOMElement, never, RF>

    Function to render the loading/fallback state. Must have no requirements (will be rendered in detached context if delay > 0).

    render: () => Element<DOMElement, E, R1>

    Async function that returns the final element. Can fail with error type E if catch is provided.