Travis build: 989

This commit is contained in:
30secondsofcode
2019-02-09 09:36:32 +00:00
parent a7ddbb5ea0
commit e0786a8944
11 changed files with 52 additions and 51 deletions

View File

@ -25,6 +25,7 @@
* [30 Seconds of Python](https://github.com/kriadmin/30-seconds-of-python-code) _(unofficial)_
* [30 Seconds of PHP](https://github.com/appzcoder/30-seconds-of-php-code) _(unofficial)_
* [30 Seconds of Kotlin](https://github.com/IvanMwiruki/30-seconds-of-kotlin) _(unofficial)_
* [30 Seconds of Knowledge](https://chrome.google.com/webstore/detail/30-seconds-of-knowledge/mmgplondnjekobonklacmemikcnhklla) _(unofficial)_
#### Package
@ -673,7 +674,7 @@ const sum = pipeAsyncFunctions(
x => x + 3,
async x => (await x) + 4
);
(async() => {
(async () => {
console.log(await sum(5)); // 15 (after one second)
})();
```

View File

@ -133,7 +133,7 @@ Object<span class="token punctuation">.</span><span class="token function">assig
x <span class="token operator">=></span> x <span class="token operator">+</span> <span class="token number">3</span><span class="token punctuation">,</span>
<span class="token keyword">async</span> x <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token keyword">await</span> x<span class="token punctuation">)</span> <span class="token operator">+</span> <span class="token number">4</span>
<span class="token punctuation">);
(</span><span class="token keyword">async</span><span class="token punctuation">()</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
(</span><span class="token keyword">async</span> <span class="token punctuation">()</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">await</span> <span class="token function">sum</span><span class="token punctuation">(</span><span class="token number">5</span><span class="token punctuation">));</span> <span class="token comment">// 15 (after one second)</span>
<span class="token punctuation">})();</span>
</pre></div><div class="card code-card"><div class="section card-content"><h4><a href="https://frontendmasters.com/courses/es6-right-parts/" target="_blank" rel="noopener noreferrer">Recommended Resource - ES6: The Right Parts</a></h4><p>Learn new ES6 JavaScript language features like arrow function, destructuring, generators & more to write cleaner and more productive, readable programs.</p></div></div><div class="card code-card"><div class="corner intermediate"></div><div class="section card-content"><h4 id="pipefunctions">pipeFunctions</h4><p>Performs left-to-right function composition.</p><p>Use <code>Array.prototype.reduce()</code> with the spread operator (<code>...</code>) to perform left-to-right function composition. The first (leftmost) function can accept one or more arguments; the remaining functions must be unary.</p></div><div class="copy-button-container"><button class="copy-button" aria-label="Copy to clipboard"></button></div><pre class="section card-code language-js"><span class="token keyword">const</span> <span class="token function-variable function">pipeFunctions</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token operator">...</span>fns<span class="token punctuation">)</span> <span class="token operator">=></span> fns<span class="token punctuation">.</span><span class="token function">reduce</span><span class="token punctuation">((</span>f<span class="token punctuation">,</span> g<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token operator">...</span>args<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token function">g</span><span class="token punctuation">(</span><span class="token function">f</span><span class="token punctuation">(</span><span class="token operator">...</span>args<span class="token punctuation">)));</span>

View File

@ -17,7 +17,7 @@ const sum = pipeAsyncFunctions(
x => x + 3,
async x => (await x) + 4
);
(async() => {
(async () => {
console.log(await sum(5)); // 15 (after one second)
})();
```