pron
Version:
Convert jquery events to promises
1 lines • 435 B
JavaScript
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){"use strict";function n(){var n=[],r=Array.prototype.slice.call(arguments),t=this;return e.each(r,function(r,o){var u=e.Deferred();e.each(t,function(n,r){e(r).one(o,function(){var e=Array.prototype.slice.call(arguments);u.resolve(e)})}),n.push(u)}),e.when.apply(null,n)}e.fn.pron=n});