0.2.0 • Published 9 years ago
nullable-value v0.2.0
Nullable
What
A tiny javascript wrapper the result which may be undefined or null
Why
we have lots of boilerplate code to handle empty value
doAsync(function(result) {
// if result is empty then crap....
result.forEach(function() {
});
});
so we can do this
doAsync(function(result) {
var result = Nullable(result).def([]).val;
// if result is empty, then nothing happened
result.forEach(function(item) {
});
});