Function scope
Wrap
fnso its invocations open Spans with identity = fn.const fadeIn = scope("fadeIn", function* () { … }); const fadeIn = scope(function* () { … });Prefer the name-first form: bare
fn.namegets renamed by bundlers when an innerfunction* fadeIncollides with an outerconst fadeIn.Type Parameters
- F extends AnyFactory
Parameters
- name: string
- fn: F
Returns Scoped<F>
Wrap
fnso its invocations open Spans with identity = fn.Prefer the name-first form: bare
fn.namegets renamed by bundlers when an innerfunction* fadeIncollides with an outerconst fadeIn.