Merge branch 'mkTimeout' into communities-allow-list

pull/1/head
ansuz 5 years ago
commit d5e8fc35f7

@ -68,6 +68,19 @@
};
};
Util.mkTimeout = function (_f, ms) {
ms = ms || 0;
var f = Util.once(_f);
var timeout = setTimeout(function () {
f('TIMEOUT');
}, ms);
return Util.both(f, function () {
clearTimeout(timeout);
});
};
Util.response = function () {
var pending = {};
var timeouts = {};

Loading…
Cancel
Save