-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
/** | ||
* This module contains some helpers borrowing some of basic the concepts from [ES pipe operator](https://tc39.es/proposal-pipeline-operator/), | ||
* enabling extending methods to existing objects in a tree-shaking-friendly way. | ||
* | ||
* ```ts | ||
* // 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 {@link PipeTarget} interface (the `$` method). | ||
* | ||
* Pipe functions should be compatible with {@link PipeFunction}. Refer to the type definition documentation for more information. | ||
* | ||
* @see [TC 39 Stage 2 Draft: ES pipe operator](https://tc39.es/proposal-pipeline-operator/) | ||
* | ||
* @module | ||
*/ | ||
import { PipeFunction, PipeTarget } from "./typing"; | ||
|
||
export * from "./typing"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters