Function scope

    • Wrap fn so its invocations open Spans with identity = fn.

       const fadeIn = scope("fadeIn", function* () { … });
       const fadeIn = scope(function* () { … });
      

      Prefer the name-first form: bare fn.name gets renamed by bundlers when an inner function* fadeIn collides with an outer const fadeIn.

      Type Parameters

      • F extends AnyFactory

      Parameters

      • fn: F

      Returns Scoped<F>

    • Wrap fn so its invocations open Spans with identity = fn.

       const fadeIn = scope("fadeIn", function* () { … });
       const fadeIn = scope(function* () { … });
      

      Prefer the name-first form: bare fn.name gets renamed by bundlers when an inner function* fadeIn collides with an outer const fadeIn.

      Type Parameters

      • F extends AnyFactory

      Parameters

      • name: string
      • fn: F

      Returns Scoped<F>