stax-monorepo
    Preparing search index...

    Interface OutletCtxService

    Service exposed on OutletCtx.

    interface OutletCtxService {
        enter: AnimationGroup;
        exit: AnimationGroup;
        scrollContainer: Effect<HTMLElement | Window>;
    }
    Index

    AnimationGroup for the outlet's own enter animation on this nav. _done fires once the enter completes — Animation.awaitDone(enter) is the canonical "wait for the new page to finish appearing" before running downstream intros.

    Fresh per nav. Runs in parallel with exit by default — sequence them yourself if you want a serial exit → enter timeline.

    AnimationGroup for the outlet's own exit animation on this nav. _done fires once the exit completes — Animation.awaitDone(exit) is the canonical "wait for the old page to finish leaving."

    Fresh per nav.

    scrollContainer: Effect<HTMLElement | Window>

    Nearest scroll target for the outlet's own container element — the first scrollable HTML ancestor on the walk up, or window when nothing scrollable is found (the common document-scrolls-the-viewport case). Both shapes expose scrollTo(options) identically, so callers pipe through Element.scrollTo without branching on null.

    Effect-typed rather than a plain ref, to match the shape of AnimationHook's Effect.Effect<HTMLElement> and integrate with the Element combinators — the outlet's container isn't populated during the initial reconcile pass, so wrapping the walk in an Effect gets it resolved at consumption time (which is always post-mount for a scroll-behavior callback).

    Router.scrollBehavior((from, to) =>
    Effect.gen(function* () {
    const outlet = yield* OutletCtx;
    yield* Element.scrollTo(outlet.scrollContainer, {
    top: 0,
    left: 0,
    behavior: "instant",
    });
    }),
    );