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>@generator</code> tag indicates that a function is a <ahref="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*">generator function</a>,
42
+
meaning that it was declared using the syntax <code>function* foo() {}</code>. This tag is available in JSDoc 3.5.0 and later.</p>
43
+
<p>In general, you do not need to use this tag, because JSDoc automatically detects generator functions and identifies them in the generated documentation. However,
44
+
if you are writing a virtual comment for a generator function that does not appear in your code, you can use this tag to tell JSDoc that the function is a
45
+
generator function.</p>
46
+
<h2id="example">Example</h2>
47
+
<p>The following example shows a virtual comment that uses the <code>@generator</code> tag:</p>
48
+
<figure>
49
+
<figcaption>Virtual comment with @generator tag</figcaption><preclass="prettyprint lang-js"><code>/**
50
+
* Generate numbers in the Fibonacci sequence.
51
+
*
52
+
* @generator
53
+
* @function fibonacci
54
+
* @yields {number} The next number in the Fibonacci sequence.
<ahref="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the JSDoc 3 documentation project.
65
+
<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