UNPKG

@refinedev/core

Version:

Refine is a React meta-framework for building enterprise-level, data-intensive applications rapidly with support for modern UI libraries and headless integrations.

11 lines (10 loc) 428 B
/** * Delays the execution of a callback function asynchronously. * This utility function is used to defer the execution of the provided * callback, allowing the current call stack to clear before the callback * is invoked. It is particularly useful for ensuring non-blocking behavior * and providing a clear intent when a 0 ms timeout is used. */ export const deferExecution = (fn: Function) => { setTimeout(fn, 0); };