Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 585 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 585 Bytes

pipeline.macro

Babel Macro

A babel macro which works similarly to the pipeline operator.

Usage

import pipe from 'pipeline.macro'

const doubleSay = str => str + ', ' + str
const capitalize = str => str[0].toUpperCase() + str.substring(1)
const exclaim = str => str + '!'

const result = pipe(
  'hello',
  doubleSay,
  capitalize,
  exclaim,
)

result // "Hello, hello!"