add Ox.void()

This commit is contained in:
rolux 2012-04-08 14:19:53 +02:00
parent 7daf1a23a0
commit 7b13e834a7

View file

@ -52,3 +52,11 @@ Ox.cache = function(fn, options) {
} }
return ret; return ret;
}; };
/*@
Ox.void <f> Returns nothing and calls options callback without arguments
This can be useful to combine a synchronous and an asynchronous code path.
@*/
Ox.void = function(callback) {
Ox.isFunction(callback) && callback();
};