Example usage:
import { defer } from "@thalesrc/js-utils/function"; defer(() => aFunctionToDefer()) .then(res => ...) .catch(err => ...);
Example as promise static method
import "@thalesrc/js-utils/function/static/defer"; Function.defer(() => aFunctionToDefer()) .then(res => ...) .catch(err => ...);
type of the return value of the callback
Callback function to be executed
A promise which resolves with the value of the callback right after the execution
Generated using TypeDoc
Delays the execution of the passed function to increase the render performance
Example usage:
import { defer } from "@thalesrc/js-utils/function"; defer(() => aFunctionToDefer()) .then(res => ...) .catch(err => ...);
Example as promise static method
import "@thalesrc/js-utils/function/static/defer"; Function.defer(() => aFunctionToDefer()) .then(res => ...) .catch(err => ...);