( updater: Updater<TInput, TOutput>, input: TInput, )
| 130 | * @returns The new value. |
| 131 | */ |
| 132 | export function functionalUpdate<TInput, TOutput>( |
| 133 | updater: Updater<TInput, TOutput>, |
| 134 | input: TInput, |
| 135 | ): TOutput { |
| 136 | return typeof updater === 'function' |
| 137 | ? (updater as (_: TInput) => TOutput)(input) |
| 138 | : updater |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Checks whether a value can be used as a timeout: a non-negative, finite number. |
no outgoing calls
no test coverage detected