@0devs/async-pipe 中文文档教程
async-pipe
将异步函数和 promises 组织到管道中,例如 promise.then、
promise.catch original repo kirillrogovoy/promised-pipe
install
npm i @0devs/async-pipe
usage
import {pipe} from "@0devs/async-pipe";
pipe(
async () => 0,
async (s) => s + 1,
async (s) => s + 1,
async (s) => s + 1,
)
.then((r) => {
console.log(r);
})
.catch((e) => {
console.log(e);
});
async-pipe
organize async functions and promises into pipe, like promise.then, promise.catch
original repo kirillrogovoy/promised-pipe
install
npm i @0devs/async-pipe
usage
import {pipe} from "@0devs/async-pipe";
pipe(
async () => 0,
async (s) => s + 1,
async (s) => s + 1,
async (s) => s + 1,
)
.then((r) => {
console.log(r);
})
.catch((e) => {
console.log(e);
});