MCPcopy
hub / github.com/webpack/webpack / lazyFunction

Function lazyFunction

lib/index.js:111–122  ·  view source on GitHub ↗
(factory)

Source from the content-addressed store, hash-verified

109 * @returns {T} function
110 */
111const lazyFunction = (factory) => {
112 const fac = memoize(factory);
113 const f = /** @type {unknown} */ (
114 /**
115 * Handles the callback logic for this hook.
116 * @param {...EXPECTED_ANY} args args
117 * @returns {T} result
118 */
119 (...args) => fac()(...args)
120 );
121 return /** @type {T} */ (f);
122};
123
124/**
125 * Merges the provided values into a single result.

Callers 1

index.jsFile · 0.85

Calls 1

memoizeFunction · 0.85

Tested by

no test coverage detected