Adds a pipe operator to call pure, synchronous transformer functions within JSX expressions.
npm install babel-plugin-transform-pipe-operatorAdds a pipe operator to call pure, synchronous transformer functions within JSX expressions.
A pipe inside a JSX expression,
``js`
const Shout = ({ name }) => (
YO, { name | toUpperCase }!
);
Becomes a function call in the result:
`js`
const Shout = ({ name }) => (
YO, { toUpperCase(name) }!
);
To pass a parameter, implement the transformer as a factory.
`js
const toFixed = (places) => (value) => value.toFixed(places);
const Cell = ({ value }) => (
`js
const toFixed = (places) => (value) => value.toFixed(places);const Cell = ({ value }) => (
{ toFixed(2)(value) }
);
``