Library API
    Preparing search index...

    Function delegate

    • Creates a dynamic Proxy where property access is forwarded to a discovery callback. Useful for virtual objects and lazy-loading data.

      Type Parameters

      • T extends object

      Parameters

      • target: T

        The base object

      • onGet: (key: string | symbol, target: T) => any

        Callback fired when an unknown property is accessed

      • readonly: boolean = true

        Whether the proxy should prevent mutations (default: true)

      Returns T

      The delegated Proxy

      const d = delegate({}, (key) => console.log('Requested:', key));