0.5.0 • Published 3 years ago

just-futures v0.5.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

About

npm.io npm npm

That simple library allows you to work with 'Futures': map, combine and compose them

Installation

npm i --save just-futures

Examples

const future = Future.incompleted<number>(); // also you can use new Future<number>();
future.map(num => num * 10 / 2).then(console.log); // 5
future.map(num => `Number: ${num}`).then(console.log); // Number: 5
future.complete(1);
const future = Future.ofPromise(...)
    .map(value => ...)
    .compose(value => Future.ofPromise(...))
    .combine(Future.ofPromise(...), (x, y) => ...)
    .then(console.log);
0.5.0

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago