Const
Creates a deprecation wrapper function that shows a warning when called.
The function to wrap
The deprecation message
Configuration options for the warning
A wrapped function that shows a deprecation warning when called
const oldFunction = deprecate( () => console.log("old implementation"), "oldFunction() is deprecated. Use newFunction() instead.");oldFunction(); // Shows warning and executes function Copy
const oldFunction = deprecate( () => console.log("old implementation"), "oldFunction() is deprecated. Use newFunction() instead.");oldFunction(); // Shows warning and executes function
Creates a deprecation wrapper function that shows a warning when called.