Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the difference between pipe and pipe/async #6

Closed
lambdalisue opened this issue Oct 4, 2024 · 2 comments
Closed

Clarify the difference between pipe and pipe/async #6

lambdalisue opened this issue Oct 4, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@lambdalisue
Copy link
Member

Explain the difference in English with maybe some code like

import { pipe } from "jsr:@core/pipe";
import { pipe as pipeAsync } from "jsr:@core/pipe/async";

const a = (v: unknown) => v;
const b = (v: unknown) => v;
const c = (v: unknown) => v;

// Equivalent
console.log(pipe(1, a, b, c)); // 1
console.log(c(b(a(1)))); // 1

// Equivalent
console.log(await pipeAsync(1, a, b, c)); // 1
console.log(await c(await b(await a(1)))); // 1
@lambdalisue lambdalisue added the documentation Improvements or additions to documentation label Oct 4, 2024
@lambdalisue
Copy link
Member Author

The original issue was #3

@lambdalisue
Copy link
Member Author

Closed by #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant