This module contains some helpers borrowing some of basic the concepts from ES pipe operator, enabling extending methods to existing objects in a tree-shaking-friendly way.
// ES pipe operator (2021)x |> func1(%, a) |> func2(%, b) |> func3(%, c)// Pipables (this module)let x: PipeTarget;x.$(func1(a)) .$(func2(b)) .$(func3(c)) Copy
// ES pipe operator (2021)x |> func1(%, a) |> func2(%, b) |> func3(%, c)// Pipables (this module)let x: PipeTarget;x.$(func1(a)) .$(func2(b)) .$(func3(c))
To enable usage with pipe functions, an object should implement PipeTarget interface (the $ method).
$
Pipe functions should be compatible with PipeFunction. Refer to the type definition documentation for more information.
TC 39 Stage 2 Draft: ES pipe operator
This module contains some helpers borrowing some of basic the concepts from ES pipe operator, enabling extending methods to existing objects in a tree-shaking-friendly way.
To enable usage with pipe functions, an object should implement PipeTarget interface (the
$
method).Pipe functions should be compatible with PipeFunction. Refer to the type definition documentation for more information.
See
TC 39 Stage 2 Draft: ES pipe operator