add mkAsync function

This commit is contained in:
ansuz
2019-06-25 11:13:03 +02:00
parent d16aa7de8a
commit 4b8a8fbe5f
2 changed files with 25 additions and 1 deletions

View File

@@ -2,6 +2,15 @@
define([], function () {
var Util = window.CryptPad_Util = {};
Util.mkAsync = function (f) {
return function () {
var args = Array.prototype.slice.call(arguments);
setTimeout(function () {
f.apply(null, args);
});
};
};
// If once is true, after the event has been fired, any further handlers which are
// registered will fire immediately, and this type of event cannot be fired twice.
Util.mkEvent = function (once) {