nullable-value
v0.2.0
Published
nullable wrapper for javascript type
Downloads
3
Readme
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) {
});
});