0.2.2 • Published 2 years ago

@lorisleiva/postpone v0.2.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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]
0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago