Keine Beschreibung

tryer.min.js 1.1KB

    !function(n){"use strict";function t(n){function t(){u()&&o()}function u(){return r("when",t)}function r(t,i){return!!n[t]()||(m(n),d(n)?n.fail():p(i,h(n)),!1)}function o(){var t;if(s(n))return(t=n.action())&&e(t.then)?t.then(f,f):f();n.action(f)}function f(){r("until",o)&&n.pass()}n=i(n),t()}function i(n){return n=n||{},{count:0,when:u(n.when),until:u(n.until),action:o(n.action),fail:o(n.fail),pass:o(n.pass),interval:a(n.interval,-1e3),limit:a(n.limit,-1)}}function u(n){return c(n,e,r)}function e(n){return"function"==typeof n}function r(){return!0}function o(n){return c(n,e,f)}function f(){}function c(n,t,i){return t(n)?n:i}function a(n,t){return c(n,l,t)}function l(n){return"number"==typeof n&&n===n}function s(n){return 0===n.action.length}function m(n){n.count+=1}function d(n){return n.limit>=0&&n.count>=n.limit}function h(n){var t=n.interval;return n.interval<0&&(n.interval*=2),t}function p(n,t){setTimeout(n,Math.abs(t))}"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof module&&null!==module?module.exports=t:n.tryer=t}(this);