Wraps a function to execute it outside of the current execution context if one exists.
This utility ensures that the wrapped function runs in isolation from any existing
ExecutionContext, preventing context leakage and unintended context sharing between
async operations.
Example
constmyFunction = async (param: string) => { // This code will run outside of any ExecutionContext returnparam.toUpperCase(); };
Wraps a function to execute it outside of the current execution context if one exists.
This utility ensures that the wrapped function runs in isolation from any existing ExecutionContext, preventing context leakage and unintended context sharing between async operations.
Example
Example