Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Interface ContextScopeOptionsAlpha

    Options for ContextRegistry.scope.

    Two knobs, both optional:

    • host, start a DOM walk from this element. Typical for components.
    • with, hand in fixed values for some context keys. Typical for tests or headless code that has no DOM host.

    They compose: pass both and with overrides whatever the DOM provides for the named keys. Pass neither and get returns undefined for everything.

    interface ContextScopeOptions {
        host?: HTMLElement;
        with?: Partial<ContextMap>;
    }
    Index

    Properties

    Properties

    host?: HTMLElement

    Element to start looking from when resolving context keys that come from the DOM.

    with?: Partial<ContextMap>

    Fixed values for specific context keys. Wins over anything the DOM or a session-wide default would provide.