Home / Function/ asyncCopyTo() — react Function Reference

asyncCopyTo() — react Function Reference

Architecture documentation for the asyncCopyTo() function in utils.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  8a7ea5c3_6cad_6857_5488_f911e195c9f1["asyncCopyTo()"]
  8d8b8676_4e81_dd5b_3542_6b355bdbb705["utils.js"]
  8a7ea5c3_6cad_6857_5488_f911e195c9f1 -->|defined in| 8d8b8676_4e81_dd5b_3542_6b355bdbb705
  ce8d8108_a709_ef45_b04b_b4fbb4a51045["asyncMkDirP()"]
  8a7ea5c3_6cad_6857_5488_f911e195c9f1 -->|calls| ce8d8108_a709_ef45_b04b_b4fbb4a51045
  style 8a7ea5c3_6cad_6857_5488_f911e195c9f1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/rollup/utils.js lines 10–27

function asyncCopyTo(from, to) {
  return asyncMkDirP(path.dirname(to)).then(
    () =>
      new Promise((resolve, reject) => {
        ncp(from, to, error => {
          if (error) {
            // Wrap to have a useful stack trace.
            reject(new Error(error));
          } else {
            // Wait for copied files to exist; ncp() sometimes completes prematurely.
            // For more detail, see github.com/facebook/react/issues/22323
            // Also github.com/AvianFlu/ncp/issues/127
            setTimeout(resolve, 10);
          }
        });
      })
  );
}

Domain

Subdomains

Frequently Asked Questions

What does asyncCopyTo() do?
asyncCopyTo() is a function in the react codebase, defined in scripts/rollup/utils.js.
Where is asyncCopyTo() defined?
asyncCopyTo() is defined in scripts/rollup/utils.js at line 10.
What does asyncCopyTo() call?
asyncCopyTo() calls 1 function(s): asyncMkDirP.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free