Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
181 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
tag: yields | ||
description: Document the value yielded by a generator function. | ||
synonyms: | ||
- yield | ||
related: | ||
- tags-returns.html | ||
--- | ||
|
||
## Syntax | ||
|
||
`@yields [{type}] [description]` | ||
|
||
|
||
## Overview | ||
|
||
The `@yields` tag documents the value that is yielded by a generator function. This tag is available | ||
in JSDoc 3.5.0 and later. | ||
|
||
If you are documenting a regular function, use the [`@returns` tag][returns-tag] instead of this | ||
tag. | ||
|
||
[returns-tag]: tags-returns.html | ||
|
||
|
||
## Examples | ||
|
||
{% example "@yields tag with a type" %} | ||
|
||
```js | ||
/** | ||
* Generate the Fibonacci sequence of numbers. | ||
* | ||
* @yields {number} | ||
*/ | ||
function* fibonacci() {} | ||
``` | ||
{% endexample %} | ||
|
||
{% example "@yields tag with a type and description" %} | ||
|
||
```js | ||
/** | ||
* Generate the Fibonacci sequence of numbers. | ||
* | ||
* @yields {number} The next number in the Fibonacci sequence. | ||
*/ | ||
function* fibonacci() {} | ||
``` | ||
{% endexample %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<!DOCTYPE html> | ||
<!-- THIS IS A GENERATED FILE. DO NOT EDIT. --> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="description" content="Document the value yielded by a generator function."> | ||
<title>Use JSDoc: @yields</title> | ||
<link rel="stylesheet" href="styles/usejsdoc.css"> | ||
<link rel="stylesheet" href="styles/prettify.css"> | ||
<link rel="stylesheet" href="styles/css3-github-ribbon.css"> | ||
<script src="scripts/prettify.js"></script> | ||
<!--[if lt IE 9]> | ||
<script src="scripts/html5shiv.min.js"></script> | ||
<script src="scripts/html5shiv-printshiv.min.js"></script> | ||
<![endif]--> | ||
</head> | ||
|
||
<body> | ||
<header> | ||
<a href="./index.html">@use JSDoc</a> | ||
</header> | ||
<article> | ||
<h1>@yields</h1> | ||
<h2>Table of Contents</h2> | ||
<ul> | ||
<li> | ||
<a href="#synonyms">Synonyms</a> | ||
</li> | ||
<li> | ||
<a href="#syntax">Syntax</a> | ||
</li> | ||
<li> | ||
<a href="#overview">Overview</a> | ||
</li> | ||
<li> | ||
<a href="#examples">Examples</a> | ||
</li> | ||
<li> | ||
<a href="#related-links">Related Links</a> | ||
</li> | ||
</ul> | ||
<h2 id="synonyms">Synonyms</h2> | ||
<p> | ||
<code>@yield</code> | ||
</p> | ||
<h2 id="syntax">Syntax</h2> | ||
<p><code>@yields [{type}] [description]</code> | ||
</p> | ||
<h2 id="overview">Overview</h2> | ||
<p>The <code>@yields</code> tag documents the value that is yielded by a generator function. This tag is available in JSDoc 3.5.0 and later.</p> | ||
<p>If you are documenting a regular function, use the <a href="tags-returns.html"><code>@returns</code> tag</a> instead of this tag. | ||
</p> | ||
<h2 id="examples">Examples</h2> | ||
<figure> | ||
<figcaption>@yields tag with a type</figcaption><pre class="prettyprint lang-js"><code>/** | ||
* Generate the Fibonacci sequence of numbers. | ||
* | ||
* @yields {number} | ||
*/ | ||
function* fibonacci() {} | ||
</code></pre> | ||
</figure> | ||
<figure> | ||
<figcaption>@yields tag with a type and description</figcaption><pre class="prettyprint lang-js"><code>/** | ||
* Generate the Fibonacci sequence of numbers. | ||
* | ||
* @yields {number} The next number in the Fibonacci sequence. | ||
*/ | ||
function* fibonacci() {} | ||
</code></pre> | ||
</figure> | ||
<h2 id="related-links">Related Links</h2> | ||
<p> | ||
<a href="tags-returns.html">@returns</a> | ||
</p> | ||
</article> | ||
<footer> | ||
<a class="license-badge" href="http://creativecommons.org/licenses/by-sa/3.0/"> | ||
<img alt="Creative Commons License" class="license-badge" src="images/cc-by-sa.svg" width="80" height="15" /> | ||
</a> | ||
<br> Copyright © 2011-2017 the | ||
<a href="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the JSDoc 3 documentation project. | ||
<br> This website is <a href="https://github.com/jsdoc3/jsdoc3.github.com">open source</a> and is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"> | ||
Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. | ||
</footer> | ||
<script type="text/javascript"> | ||
prettyPrint(); | ||
</script> | ||
</body> | ||
|
||
</html> |