You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The <code>@async</code> tag indicates that a function is <ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function">asynchronous</a>,
42
+
meaning that it was declared using the syntax <code>async function foo() {}</code>. Do not use this tag for other types of asynchronous functions, such as
43
+
functions that provide a callback. This tag is available in JSDoc 3.5.0 and later.</p>
44
+
<p>In general, you do not need to use this tag, because JSDoc automatically detects asynchronous functions and identifies them in the generated documentation. However,
45
+
if you are writing a virtual comment for an asynchronous function that does not appear in your code, you can use this tag to tell JSDoc that the function is
46
+
asynchronous.</p>
47
+
<h2id="example">Example</h2>
48
+
<p>The following example shows a virtual comment that uses the <code>@async</code> tag:</p>
49
+
<figure>
50
+
<figcaption>Virtual comment with @async tag</figcaption><preclass="prettyprint lang-js"><code>/**
51
+
* Download data from the specified URL.
52
+
*
53
+
* @async
54
+
* @function downloadData
55
+
* @param {string} url - The URL to download from.
56
+
* @return {Promise<string>} The data from the URL.
<ahref="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the JSDoc 3 documentation project.
67
+
<br> This website is <ahref="https://github.com/jsdoc3/jsdoc3.github.com">open source</a> and is licensed under the <arel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
0 commit comments