$ npm install monapt
;Option1.mapx * 2.getOrElse4;
You can also take a look at the tests to get a feel for how to use them.
Changes in 1.0
1.0 was a complete rewrite of Monapt - including everything from the implementation to the tooling to the tests. The result is almost the same API, but more true to the original Scala interface.
Migrating from 0.7.1
- All default exports have been removed to avoid ambiguity.
Futurenow depends on native ES6 Promises, and uses them internally when representing promises. Make sure to include a shim if you plan on using Futures.
Future#onFailurehas been removed.
Future#onSuccesshas been removed.
Future#rejecthas been removed.
Monapt::flattenhas been renamed to
Monapt::futurehas been renamed to
Future::create. It now accepts a
when.Promise<A> | when.Thenable<A> | A.
Option#rejecthas been renamed to
Try#rejecthas been removed.
These are all backed by type definitions, so compiling your code via TypeScript should reveal any breakages.
This repo couldn't have been possible without yaakaito/monapt. In his absence, I'll continue improving upon his hard work.