diff --git a/source/flow.js b/source/flow.js index 87e1da7b1..63fce4f21 100644 --- a/source/flow.js +++ b/source/flow.js @@ -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);