Browse Source

[docs] Updated docs for Fuse#else

master
Muthu Kumar 7 years ago
parent
commit
d3c659c18c
  1. 164
      docs/Fuse.html
  2. 2
      docs/FuseItem.html
  3. 2
      docs/FuseIterable.html
  4. 2
      docs/global.html
  5. 19
      docs/index.html
  6. 12
      docs/index.js.html

164
docs/Fuse.html

@ -158,6 +158,164 @@
<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>
@ -283,7 +441,7 @@ equality with this.value.
<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#line164">line 164</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line174">line 174</a>
</li></ul></dd>
@ -464,7 +622,7 @@ inequality with this.value.
<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#line176">line 176</a>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line186">line 186</a>
</li></ul></dd>
@ -831,7 +989,7 @@ Used in case a resolve is never found.
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 11 2018 11:02:55 GMT+0530 (IST)
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>

2
docs/FuseItem.html

@ -584,7 +584,7 @@ Used in case a resolve is never found.
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 11 2018 11:02:55 GMT+0530 (IST)
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>

2
docs/FuseIterable.html

@ -835,7 +835,7 @@ each value into the winning consequent function.
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 11 2018 11:02:55 GMT+0530 (IST)
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>

2
docs/global.html

@ -465,7 +465,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 11 2018 11:02:55 GMT+0530 (IST)
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>

19
docs/index.html

@ -45,8 +45,7 @@
<section>
<article><h1>Fuse</h1><p><strong>FunctionSelect</strong></p>
<p><code>Fuse</code> selects a function that passes a condition.</p>
<h2>Usage</h2><pre class="prettyprint source lang-JavaScript"><code>const Fuse = require('@codefeathers/fuse');
const { FuseIterable } = require('@codefeathers/fuse');
<h2>Usage</h2><h3>Fuse</h3><pre class="prettyprint source lang-JavaScript"><code>const Fuse = require('@codefeathers/fuse');
const a = 100;
@ -58,7 +57,19 @@ const result = new Fuse(a)
.on(x => x===10,
a => `${a} is 10.`)
console.log(result.resolve()); // -> &quot;100 is greater than 10.&quot;</code></pre><h2>Docs</h2><p>Docs exist in <code>/docs</code> directory. Will be served soon.</p>
console.log(result.resolve()); // -> &quot;100 is greater than 10.&quot;</code></pre><h3>FuseIterable</h3><pre class="prettyprint source lang-JavaScript"><code>const { FuseIterable } = require('@codefeathers/fuse');
const temperatures = [ 0, 20, 30 ];
const result = new FuseIterable(temperatures)
.on(temp => temp&lt;10,
() => `Too cold!`)
.on(temp => temp>=10 && temp &lt;25,
() => `Just right.`)
.on(temp => temp>=25,
() => `Too warm!`)
console.log(result.resolve()); // -> [ &quot;Too cold!&quot;, &quot;Just right.&quot;, &quot;Too warm!&quot; ]</code></pre><h2>Docs</h2><p>Docs exist in <code>/docs</code> directory. Will be served soon.</p>
<h2>Development</h2><blockquote>
<p>If you find any mistakes in code/documentation, or if you feel something could be done better, do PR :) I appreciate it.</p>
</blockquote>
@ -87,7 +98,7 @@ console.log(result.resolve()); // -> &quot;100 is greater than 10.&quot;</code><
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 11 2018 11:02:55 GMT+0530 (IST)
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>

12
docs/index.js.html

@ -183,6 +183,16 @@ class Fuse extends FuseItem {
}
/**
* Accepts a consequent function which automatically becomes resolve.
* Does not return a Fuse instance as .on after .else would be useless.
* @param {callback} consequent Consequent callback function
* @returns {Fuse} Returns new FuseItem instance
*/
else(consequent) {
return new FuseItem(this.value, consequent);
}
/**
* Accepts a value instead of a test function, and checks for strict
* equality with this.value.
* @param {any} value Any value to check against this.value
@ -224,7 +234,7 @@ module.exports.FuseIterable = FuseIterable;
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 11 2018 11:02:55 GMT+0530 (IST)
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>

Loading…
Cancel
Save