Comparing version 0.1.1 to 0.1.2
@@ -5,3 +5,3 @@ { | ||
"description": "priority based work scheduler for javascript", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/thysultan/schedula.js", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -30,3 +30,3 @@ # schedula.js | ||
```html | ||
<script src=https://unpkg.com/schedula.js@0.1.1/schedula.min.js></script> | ||
<script src=https://unpkg.com/schedula.js@0.1.2/schedula.min.js></script> | ||
``` | ||
@@ -33,0 +33,0 @@ |
@@ -35,3 +35,3 @@ /** | ||
scheduleCallback = function scheduleCallback (callback) { | ||
requestIdleCallback(callback); | ||
setImmediate(callback); | ||
} | ||
@@ -144,3 +144,3 @@ } | ||
} | ||
// throttled scheduler | ||
@@ -147,0 +147,0 @@ scheduleCallback(throttle); |
@@ -1,1 +0,1 @@ | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.schedula=e(window)}(function(e){function n(e){function n(e){var n;if(e){if(0===o)return;n=i.shift()}else{if(0===r)return;n=l.shift()}var t=n[0],a=n[1],c=n[2],u=0===c?null:n[3];switch(c){case 0:a.call(t);break;case 1:a.call(t,u[0]);break;case 2:a.call(t,u[0],u[1]);break;case 3:a.call(t,u[0],u[1],u[2]);break;case 4:a.call(t,u[0],u[1],u[2],u[3]);break;case 5:a.call(t,u[0],u[1],u[2],u[3],u[4]);break;case 6:a.call(t,u[0],u[1],u[2],u[3],u[4],u[5]);break;case 7:a.call(t,u[0],u[1],u[2],u[3],u[4],u[5],u[6]);break;case 8:a.call(t,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7])}e?o--:r--}function a(){var e=Date.now(),c=e-f;c>u?(f=e-c%u,0!==o?n(!0):0!==r&&n(!1)):0===o&&0===r||t(a)}function c(e,n,c,u,f){e?i[o++]=[n,c,u,f]:l[r++]=[n,c,u,f],t(a)}var i=[],l=[],o=0,r=0,u=1e3/(e||60),f=0;return Object.create(null,{flush:{value:n},push:{value:c},budget:{get:function(){return e},set:function(n){u=1e3/(e=n)}},work:{get:function(){return{high:i,low:l}}}})}var t,a=e.Promise,c=e.requestAnimationFrame,i=e.setImmediate;return t=void 0!==c?function(e){c(e)}:void 0!==i?function(e){requestIdleCallback(e)}:void 0!==a?function(e){a.resolve().then(e)}:function(e){setTimeout(e,0)},n}); | ||
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.schedula=e(window)}(function(e){function n(e){function n(e){var n;if(e){if(0===l)return;n=i.shift()}else{if(0===r)return;n=o.shift()}var t=n[0],a=n[1],c=n[2],u=0===c?null:n[3];switch(c){case 0:a.call(t);break;case 1:a.call(t,u[0]);break;case 2:a.call(t,u[0],u[1]);break;case 3:a.call(t,u[0],u[1],u[2]);break;case 4:a.call(t,u[0],u[1],u[2],u[3]);break;case 5:a.call(t,u[0],u[1],u[2],u[3],u[4]);break;case 6:a.call(t,u[0],u[1],u[2],u[3],u[4],u[5]);break;case 7:a.call(t,u[0],u[1],u[2],u[3],u[4],u[5],u[6]);break;case 8:a.call(t,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7])}e?l--:r--}function a(){var e=Date.now(),c=e-f;c>u?(f=e-c%u,0!==l?n(!0):0!==r&&n(!1)):0===l&&0===r||t(a)}function c(e,n,c,u,f){e?i[l++]=[n,c,u,f]:o[r++]=[n,c,u,f],t(a)}var i=[],o=[],l=0,r=0,u=1e3/(e||60),f=0;return Object.create(null,{flush:{value:n},push:{value:c},budget:{get:function(){return e},set:function(n){u=1e3/(e=n)}},work:{get:function(){return{high:i,low:o}}}})}var t,a=e.Promise,c=e.requestAnimationFrame,i=e.setImmediate;return t=void 0!==c?function(e){c(e)}:void 0!==i?function(e){i(e)}:void 0!==a?function(e){a.resolve().then(e)}:function(e){setTimeout(e,0)},n}); |
8890