Skip to main content

Function: deprecatedLoader()

deprecatedLoader<L>(fn, replacement, target): L

Defined in: src/core/releases.ts:892

A loader whose release tag was retired: forwards to target() (a thunk, so the replacement may be declared later in the module) with a one-time DeprecationWarning.

Type Parameters​

L​

L

Parameters​

fn​

string

The deprecated loader's name, as it appears in the warning and as the once-per-process key.

replacement​

string

The name to recommend ("<fn> is deprecated; use <replacement> instead.").

target​

() => L

A thunk returning the replacement loader; called on every invocation, so it may refer to a loader declared later in the module.

Returns​

L

A function of the same type L that forwards its single argument to target().

Remarks​

The warning is emitted once per fn per process (module-level set); the forwarded call's own errors / rejections pass through unchanged. Only one positional argument is forwarded.

Example​

export const loadNflPbpOld = deprecatedLoader("load_nfl_pbp_old", "load_nfl_pbp", () => loadNflPbp);