lolo-test
v0.0.2
Published
Inspired by Scala's `Try` classes (including `Success` and `Failure`).
Downloads
12
Readme
lolo__
Inspired by Scala's Try
classes (including Success
and Failure
).
Go lolo__ or go nono
By using lolo
you can avoid most try-catch blocks in your code. That is because lolo
wraps around possible exceptions and simply returns whether it succeeded or failed.
Don't get it? Here is an example that will always succeed:
let result = __<User>(() => userFactory.create('Jack'))
.map(e => e.name)
.map(e => e.substr(-1) === 'k')
.value;
// Result will be true.
console.log(result);