FunctionSelect: Select a function that passes a condition. A functional alternative to switch-case.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

998 lines
11 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: Fuse</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: Fuse</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>Fuse<span class="signature">()</span><span class="type-signature"></span></h2>
</header>
<article>
<div class="container-overview">
<h4 class="name" id="Fuse"><span class="type-signature"></span>new Fuse<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Creates a new Fuse instance.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line128">line 128</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="FuseItem.html">FuseItem</a></li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="else"><span class="type-signature"></span>else<span class="signature">(consequent)</span><span class="type-signature"> &rarr; {<a href="Fuse.html">Fuse</a>}</span></h4>
<div class="description">
Accepts a consequent function which automatically becomes resolve.
Does not return a Fuse instance as .on after .else would be useless.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>consequent</code></td>
<td class="type">
<span class="param-type">callback</span>
</td>
<td class="description last">Consequent callback function</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line163">line 163</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns new FuseItem instance
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Fuse.html">Fuse</a></span>
</dd>
</dl>
<h4 class="name" id="is"><span class="type-signature"></span>is<span class="signature">(value, consequent)</span><span class="type-signature"> &rarr; {<a href="Fuse.html">Fuse</a>}</span></h4>
<div class="description">
Accepts a value instead of a test function, and checks for strict
equality with this.value.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last">Any value to check against this.value</td>
</tr>
<tr>
<td class="name"><code>consequent</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Consequent callback function</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line174">line 174</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An instance of Fuse
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Fuse.html">Fuse</a></span>
</dd>
</dl>
<h4 class="name" id="not"><span class="type-signature"></span>not<span class="signature">(value, consequent)</span><span class="type-signature"> &rarr; {<a href="Fuse.html">Fuse</a>}</span></h4>
<div class="description">
Accepts a value instead of a test function, and checks for strict
inequality with this.value.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last">Any value to check against this.value</td>
</tr>
<tr>
<td class="name"><code>consequent</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">Consequent callback function</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line186">line 186</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
An instance of Fuse
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Fuse.html">Fuse</a></span>
</dd>
</dl>
<h4 class="name" id="on"><span class="type-signature"></span>on<span class="signature">(predicate, consequent)</span><span class="type-signature"> &rarr; {<a href="Fuse.html">Fuse</a>}</span></h4>
<div class="description">
Accepts a test and consequent function each and returns a new
Fuse or FuseIterable instance.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>predicate</code></td>
<td class="type">
<span class="param-type">callback</span>
</td>
<td class="description last">A test callback function</td>
</tr>
<tr>
<td class="name"><code>consequent</code></td>
<td class="type">
<span class="param-type">callback</span>
</td>
<td class="description last">Consequent callback function</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line143">line 143</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns a new Fuse instance
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Fuse.html">Fuse</a></span>
</dd>
</dl>
<h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">()</span><span class="type-signature"> &rarr; {null}</span></h4>
<div class="description">
Fallback resolve prototype. Returns null when called.
Used in case a resolve is never found.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="FuseItem.html#resolve">FuseItem#resolve</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line49">line 49</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
null
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">null</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Fuse.html">Fuse</a></li><li><a href="FuseItem.html">FuseItem</a></li><li><a href="FuseIterable.html">FuseIterable</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Apr 20 2018 02:24:29 GMT+0530 (IST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>