Skip to content

lorisleiva/postpone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postpone 🦥

Small TypeScript library making it easier to handle complex asynchronous tasks.

Installation

npm install @lorisleiva/postpone

Usage

import { Postpone } from "@lorisleiva/postpone";

Postpone.make(async () => "Hello")
  .tap(v => console.log(v))
  .pipe(v => `${v} world`)
  .tap(v => console.log(v))
  .pipe(v => [v, v, v])
  .tap(v => console.log(v))
  .map(() => Math.round(Math.random() * 100))
  .tap(v => console.log(v))
  .run(); // <- The promise is only executed at this point.

// Console outputs:
// "Hello"
// "Hello world"
// ["Hello world", "Hello world", "Hello world"]
// [12, 94, 23]

About

🦥 Handle asynchronous JS pipelines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published