just-try
v2.1.0
Published
Functional try-catch
Downloads
36
Readme
just-try
Requirements
- Node >= 6.0.0
Usage
Function tryCatch
var tryCatch = require('just-try');
var valorerr = tryCatch(act, onerror, onsuccess); // return value of onerror or onsuccess
dosomething(valorerr);
Function tryCatch.tuple
var tuple = require('just-try').tuple;
var errandval = tuple(act); // an array of [error, value]
dosomething(errandval);