(factory)
| 109 | * @returns {T} function |
| 110 | */ |
| 111 | const 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. |