From 7b13e834a7702589377ede907c73170dbe4932d2 Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 8 Apr 2012 14:19:53 +0200 Subject: [PATCH] add Ox.void() --- source/Ox/js/Function.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/Ox/js/Function.js b/source/Ox/js/Function.js index 02d79167..789c0946 100644 --- a/source/Ox/js/Function.js +++ b/source/Ox/js/Function.js @@ -52,3 +52,11 @@ Ox.cache = function(fn, options) { } return ret; }; + +/*@ +Ox.void 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(); +}; \ No newline at end of file