Skip to content

Commit

Permalink
Chore: make Flow jsdoc example runnable in the repl (#3462)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harris-Miller committed May 2, 2024
1 parent dcaac73 commit 6d83500
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/flow.js
Expand Up @@ -27,11 +27,11 @@ import _reduce from './internal/_reduce.js';
* @return {*} z The result of applying the seed value to the function pipeline
* @see R.pipe
* @example
* R.flow(9, [Math.sqrt, R.negate, R.inc]), //=> -2
* R.flow(9, [Math.sqrt, R.negate, R.inc]); //=> -2
*
* const defaultName = 'Jane Doe';
* const savedName = R.flow(localStorage.get('name'), [R.when(R.isNil(defaultName)), R.match(/(.+)\s/), R.nth(0)]);
* const givenName = R.flow($givenNameInput.value, [R.trim, R.when(R.isEmpty, R.always(savedName))])
* const personObj = { first: 'Jane', last: 'Doe' };
* const fullName = R.flow(personObj, [R.values, R.join(' ')]); //=> "Jane Doe"
* const givenName = R.flow(' ', [R.trim, R.when(R.isEmpty, R.always(fullName))]); //=> "Jane Doe"
*/
var flow = _curry2(function flow(seed, pipeline) {
return _reduce(applyTo, seed, pipeline);
Expand Down

0 comments on commit 6d83500

Please sign in to comment.