liveBook · Manning

Pipeline

As explained in Functional Programming in JavaScript

A Ramda function that composes functions from left to right into a new function.

A pipeline connects functions so that one function’s output becomes the next function’s input. This separates the functions from any owning object and makes the sequence more flexible than a tightly coupled method chain. section 4.1

A string transformation

Start with a string, take a substring, convert the result to lowercase, and append text. Method syntax writes these steps fluently; a functional rewrite makes each input explicit and leaves the original immutable. section 3.2

Pipelines are useful when:

  • Functions should connect without depending on one wrapper or owning object. section 4.1
  • Inputs and outputs need to be understood as mappings between types. section 4.1
  • Array operations such as filtering, mapping, deduplication, and sorting form a readable sequence. section 4.1

How Functional Programming in JavaScript covers it

How deep it goes
Explains inputs, outputs, type mappings, and coupling, but stops short of implementing a general pipeline utility.
Examples
Uses string transformations, an isEmpty function, and a Lodash array chain involving filter, map, uniq, and sort.
What it assumes
Assumes basic JavaScript functions, strings, arrays, and method calls while developing input-output reasoning.
What you can do after
Apply it by arranging functions whose outputs match the next functions’ inputs, including functions from different libraries.
How it connects
Links pipelines to method chaining, functional programming, immutable objects, arrays, and referential transparency.

Also explained in

Compare how 48 books explain pipeline →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Functional Programming in JavaScript. The section links point to the parts of the book it draws on.