effex-monorepo
    Preparing search index...

    Interface MatchConfig<A, E, R, E2, R2>

    Configuration for the match control flow (DOM-specific with animation support).

    interface MatchConfig<A, E = never, R = never, E2 = never, R2 = never> {
        animate?: AnimationOptions;
        cases: readonly MatchCase<A, E, R>[];
        container?: () => Element<HTMLElement | SVGElement, never, never>;
        extractPattern?: (value: A) => unknown;
        fallback?: () => Element<HTMLElement | SVGElement, E2, R2>;
    }

    Type Parameters

    • A
    • E = never
    • R = never
    • E2 = never
    • R2 = never
    Index

    Properties

    Optional animation configuration

    cases: readonly MatchCase<A, E, R>[]

    Array of pattern-render pairs

    container?: () => Element<HTMLElement | SVGElement, never, never>

    Optional custom container element. If not provided, defaults to a div with display: contents.

    extractPattern?: (value: A) => unknown

    Optional function to extract the pattern from the value for matching. Use this when the value contains additional information for change detection (like a path) but the pattern matching should use a subset (like route name).

    match(routeWithPath, {
    cases: [{ pattern: "users", render: () => UsersPage() }],
    extractPattern: (value) => value?.split("::")[0], // "users::/users/1" -> "users"
    })
    fallback?: () => Element<HTMLElement | SVGElement, E2, R2>

    Optional fallback if no pattern matches