cloneFunction<TFunction>
Clone a function by creating a new function that calls the original function.
This is useful for creating a new instance of a function that has the same behavior but is not strictly equal to the original function.
Import:
import { cloneFunction } from 'obsidian-dev-utils/function';Signature:
function cloneFunction(fn: TFunction): TFunctionParameters:
| Parameter | Type | Description |
|---|---|---|
fn | TFunction | The function to clone. |
Returns: TFunction — A new function that has the same behavior as the original function.