Skip to content

Instantly share code, notes, and snippets.

@iandev
Last active August 29, 2015 13:58
Show Gist options
  • Save iandev/10024283 to your computer and use it in GitHub Desktop.
Save iandev/10024283 to your computer and use it in GitHub Desktop.
var clrCallstck = -1;
serialize = function(next, add) {
return function(type) {
return _this["add" + type](add, function() {
clrCallstck++;
if (clrCallstck % 50 == 0)
return setTimeout(function() {next(type);}, 0);
else
return next(type);
});
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment