<article><h1>select-return</h1><p>Return a function based on a condition. Functional alternative to switch-case.</p>
<h2>Usage</h2><preclass="prettyprint source lang-JavaScript"><code>const a = 100;
const result = new Select(a)
.for(x => x>10,
a => `${a} is greater than 10.`)
.for(x => x<10,
a => `${a} is lesser than 10.`)
.for(x => x===10,
a => `${a} is 10.`)
console.log(result.resolve()); // -> "100 is greater than 10."</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 :)</p>
</blockquote>
<blockquote>
<p>I appreciate it.</p>
</blockquote>
<ul>
<li>Always write test spec for any code you add. Make sure they run as intended.</li>
<li>Add/update JSDoc comments as needed.</li>
<li>Use npm scripts for linting, debugging, building docs.</li>
</ul>
<p>Place your test file as <code>testscript.js</code> in root.</p>
<p>The following npm scripts are available: <code>npm run lint</code>, <code>npm run debug</code>, <code>npm run docs</code>.</p>