fetch-observable
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -59,6 +59,2 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _PausableObservable = __webpack_require__(2); | ||
@@ -172,3 +168,3 @@ | ||
exports.default = fetchObservable; | ||
module.exports = fetchObservable; | ||
@@ -175,0 +171,0 @@ /***/ }, |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fetchObservable=t():e.fetchObservable=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"string"==typeof e}function i(e){return"function"==typeof e}function u(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.refreshDelay,r=void 0===n?!1:n,u=[],c=null,f=!1,a=0;(f=o(e))&&(e=[e]);var l=function v(){if(0!==u.length&&!p.paused()){var n=function(){r?c=setTimeout(v,i(r)?r(a++):r):(p.pause(),u.map(function(e){return e.complete()}),u=[])},o=e.map(function(e){return fetch(e,t)});Promise.all(o).then(function(e){u.map(function(t){return t.next(f?e[0]:e)}),n()})["catch"](function(e){u.map(function(t){return t.error(f?e[0]:e)}),n()})}},p=new s["default"](function(e){return u.push(e),u.length&&p.resume(),function(){u.splice(u.indexOf(e),1),u.length||p.pause()}},{onPause:function(){c&&(clearTimeout(c),c=null)},onResume:function(){c||l()}});return p.resume(),p}Object.defineProperty(t,"__esModule",{value:!0});var c=n(2),s=r(c);t["default"]=u},function(e,t,n){(function(e,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function i(e){Symbol[e]||Object.defineProperty(Symbol,e,{value:Symbol(e)})}function u(e){return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(e,t,{enumerable:!1})}),e}function c(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function s(e){var t=e._cleanup;t&&(e._cleanup=void 0,t())}function f(e){return void 0===e._observer}function a(e){f(e)||(e._observer=void 0,s(e))}function l(e){return function(t){e.unsubscribe()}}function p(e,t){if(Object(e)!==e)throw new TypeError("Observer must be an object");var n=new v(e),r=new h(n),o=c(e,"start");if(o&&o.call(e,r),f(n))return r;try{var i=t.call(void 0,n);if(null!=i){if("function"==typeof i.unsubscribe)i=l(i);else if("function"!=typeof i)throw new TypeError(i+" is not a function");n._cleanup=i}}catch(u){return n.error(u),r}return f(n)&&s(n),r}function v(e){this._observer=e,this._cleanup=void 0}function h(e){this._observer=e}var b=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var y=function(){if("undefined"!=typeof e&&"undefined"!=typeof n&&n.nextTick)return e.setImmediate?function(t){e.setImmediate(t)}:function(e){n.nextTick(e)};var t=self.MutationObserver||self.WebKitMutationObserver;if(t){var r=function(){var e=document.createElement("div"),n=function(t){return e.classList.toggle("x")},r=[],o=new t(function(e){for(r.length>1&&n();r.length>0;)r.shift()()});return o.observe(e,{attributes:!0}),{v:function(e){r.push(e),1===r.length&&n()}}}();if("object"===("undefined"==typeof r?"undefined":o(r)))return r.v}return function(e){setTimeout(e,0)}}();i("observable"),v.prototype=u({get closed(){return f(this)},next:function(e){if(!f(this)){var t=this._observer;try{var n=c(t,"next");if(!n)return;return n.call(t,e)}catch(r){try{a(this)}finally{throw r}}}},error:function(e){if(f(this))throw e;var t=this._observer;this._observer=void 0;try{var n=c(t,"error");if(!n)throw e;e=n.call(t,e)}catch(r){try{s(this)}finally{throw r}}return s(this),e},complete:function(e){if(!f(this)){var t=this._observer;this._observer=void 0;try{var n=c(t,"complete");e=n?n.call(t,e):void 0}catch(r){try{s(this)}finally{throw r}}return s(this),e}}}),h.prototype=u({unsubscribe:function(){a(this._observer)}});t.Observable=function(){function e(t){if(r(this,e),"function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return b(e,[{key:"subscribe",value:function(e){return p(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise(function(n,r){if("function"!=typeof e)throw new TypeError(e+" is not a function");t.subscribe({next:function(t){try{return e(t)}catch(n){r(n)}},error:r,complete:n})})}},{key:Symbol.observable,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=c(t,Symbol.observable);if(r){var i=function(){var e=r.call(t);if(Object(e)!==e)throw new TypeError(e+" is not an object");return e.constructor===n?{v:e}:{v:new n(function(t){return e.subscribe(t)})}}();if("object"===("undefined"==typeof i?"undefined":o(i)))return i.v}return new n(function(e){y(function(n){if(!e.closed){try{var r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var s=u.value;if(e.next(s),e.closed)return}}catch(f){o=!0,i=f}finally{try{!r&&c["return"]&&c["return"]()}finally{if(o)throw i}}}catch(a){return void e.error(a)}e.complete()}})})}},{key:"of",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o(function(e){y(function(t){if(!e.closed){for(var r=0;r<n.length;++r)if(e.next(n[r]),e.closed)return;e.complete()}})})}},{key:Symbol.species,get:function(){return this}}]),e}()}).call(t,function(){return this}(),n(3))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=function a(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:a(o,t,n)}if("value"in r)return r.value;var i=r.get;if(void 0!==i)return i.call(n)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),f=function(e){function t(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];r(this,t);var i=o(this,Object.getPrototypeOf(t).call(this,e));return i.options=n,i.state="paused",i}return i(t,e),u(t,[{key:"pause",value:function(){if(this.state="paused",this.options.onPause){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];this.options.onPause.apply(this,t)}return this}},{key:"resume",value:function(){if(this.state="resumed",this.options.onResume){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];this.options.onResume.apply(this,t)}return this}},{key:"paused",value:function(){return"paused"===this.state}},{key:"subscribe",value:function(e){var n=c(Object.getPrototypeOf(t.prototype),"subscribe",this).call(this,e),r=this;return n.active=function(){return void 0!==this._observer&&!r.paused()},n.resubscribe=function(){return this.active()?!1:r.subscribe(e)},n}}]),t}(s.Observable);t["default"]=f},function(e,t){function n(){f=!1,u.length?s=u.concat(s):a=-1,s.length&&r()}function r(){if(!f){var e=setTimeout(n);f=!0;for(var t=s.length;t;){for(u=s,s=[];++a<t;)u&&u[a].run();a=-1,t=s.length}u=null,f=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var u,c=e.exports={},s=[],f=!1,a=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new o(e,t)),1!==s.length||f||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=i,c.addListener=i,c.once=i,c.off=i,c.removeListener=i,c.removeAllListeners=i,c.emit=i,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fetchObservable=t():e.fetchObservable=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"string"==typeof e}function i(e){return"function"==typeof e}function u(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.refreshDelay,r=void 0===n?!1:n,u=[],c=null,f=!1,a=0;(f=o(e))&&(e=[e]);var l=function v(){if(0!==u.length&&!p.paused()){var n=function(){r?c=setTimeout(v,i(r)?r(a++):r):(p.pause(),u.map(function(e){return e.complete()}),u=[])},o=e.map(function(e){return fetch(e,t)});Promise.all(o).then(function(e){u.map(function(t){return t.next(f?e[0]:e)}),n()})["catch"](function(e){u.map(function(t){return t.error(f?e[0]:e)}),n()})}},p=new s["default"](function(e){return u.push(e),u.length&&p.resume(),function(){u.splice(u.indexOf(e),1),u.length||p.pause()}},{onPause:function(){c&&(clearTimeout(c),c=null)},onResume:function(){c||l()}});return p.resume(),p}var c=n(2),s=r(c);e.exports=u},function(e,t,n){(function(e,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function i(e){Symbol[e]||Object.defineProperty(Symbol,e,{value:Symbol(e)})}function u(e){return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(e,t,{enumerable:!1})}),e}function c(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function s(e){var t=e._cleanup;t&&(e._cleanup=void 0,t())}function f(e){return void 0===e._observer}function a(e){f(e)||(e._observer=void 0,s(e))}function l(e){return function(t){e.unsubscribe()}}function p(e,t){if(Object(e)!==e)throw new TypeError("Observer must be an object");var n=new v(e),r=new h(n),o=c(e,"start");if(o&&o.call(e,r),f(n))return r;try{var i=t.call(void 0,n);if(null!=i){if("function"==typeof i.unsubscribe)i=l(i);else if("function"!=typeof i)throw new TypeError(i+" is not a function");n._cleanup=i}}catch(u){return n.error(u),r}return f(n)&&s(n),r}function v(e){this._observer=e,this._cleanup=void 0}function h(e){this._observer=e}var b=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var y=function(){if("undefined"!=typeof e&&"undefined"!=typeof n&&n.nextTick)return e.setImmediate?function(t){e.setImmediate(t)}:function(e){n.nextTick(e)};var t=self.MutationObserver||self.WebKitMutationObserver;if(t){var r=function(){var e=document.createElement("div"),n=function(t){return e.classList.toggle("x")},r=[],o=new t(function(e){for(r.length>1&&n();r.length>0;)r.shift()()});return o.observe(e,{attributes:!0}),{v:function(e){r.push(e),1===r.length&&n()}}}();if("object"===("undefined"==typeof r?"undefined":o(r)))return r.v}return function(e){setTimeout(e,0)}}();i("observable"),v.prototype=u({get closed(){return f(this)},next:function(e){if(!f(this)){var t=this._observer;try{var n=c(t,"next");if(!n)return;return n.call(t,e)}catch(r){try{a(this)}finally{throw r}}}},error:function(e){if(f(this))throw e;var t=this._observer;this._observer=void 0;try{var n=c(t,"error");if(!n)throw e;e=n.call(t,e)}catch(r){try{s(this)}finally{throw r}}return s(this),e},complete:function(e){if(!f(this)){var t=this._observer;this._observer=void 0;try{var n=c(t,"complete");e=n?n.call(t,e):void 0}catch(r){try{s(this)}finally{throw r}}return s(this),e}}}),h.prototype=u({unsubscribe:function(){a(this._observer)}});t.Observable=function(){function e(t){if(r(this,e),"function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return b(e,[{key:"subscribe",value:function(e){return p(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise(function(n,r){if("function"!=typeof e)throw new TypeError(e+" is not a function");t.subscribe({next:function(t){try{return e(t)}catch(n){r(n)}},error:r,complete:n})})}},{key:Symbol.observable,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=c(t,Symbol.observable);if(r){var i=function(){var e=r.call(t);if(Object(e)!==e)throw new TypeError(e+" is not an object");return e.constructor===n?{v:e}:{v:new n(function(t){return e.subscribe(t)})}}();if("object"===("undefined"==typeof i?"undefined":o(i)))return i.v}return new n(function(e){y(function(n){if(!e.closed){try{var r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var s=u.value;if(e.next(s),e.closed)return}}catch(f){o=!0,i=f}finally{try{!r&&c["return"]&&c["return"]()}finally{if(o)throw i}}}catch(a){return void e.error(a)}e.complete()}})})}},{key:"of",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o(function(e){y(function(t){if(!e.closed){for(var r=0;r<n.length;++r)if(e.next(n[r]),e.closed)return;e.complete()}})})}},{key:Symbol.species,get:function(){return this}}]),e}()}).call(t,function(){return this}(),n(3))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=function a(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:a(o,t,n)}if("value"in r)return r.value;var i=r.get;if(void 0!==i)return i.call(n)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),f=function(e){function t(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];r(this,t);var i=o(this,Object.getPrototypeOf(t).call(this,e));return i.options=n,i.state="paused",i}return i(t,e),u(t,[{key:"pause",value:function(){if(this.state="paused",this.options.onPause){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];this.options.onPause.apply(this,t)}return this}},{key:"resume",value:function(){if(this.state="resumed",this.options.onResume){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];this.options.onResume.apply(this,t)}return this}},{key:"paused",value:function(){return"paused"===this.state}},{key:"subscribe",value:function(e){var n=c(Object.getPrototypeOf(t.prototype),"subscribe",this).call(this,e),r=this;return n.active=function(){return void 0!==this._observer&&!r.paused()},n.resubscribe=function(){return this.active()?!1:r.subscribe(e)},n}}]),t}(s.Observable);t["default"]=f},function(e,t){function n(){f=!1,u.length?s=u.concat(s):a=-1,s.length&&r()}function r(){if(!f){var e=setTimeout(n);f=!0;for(var t=s.length;t;){for(u=s,s=[];++a<t;)u&&u[a].run();a=-1,t=s.length}u=null,f=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function i(){}var u,c=e.exports={},s=[],f=!1,a=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new o(e,t)),1!==s.length||f||setTimeout(r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=i,c.addListener=i,c.once=i,c.off=i,c.removeListener=i,c.removeAllListeners=i,c.emit=i,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}}])}); |
{ | ||
"name": "fetch-observable", | ||
"description": "Observable-based Fetch API", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "BSD-3-Clause", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -100,2 +100,2 @@ /** | ||
export default fetchObservable; | ||
module.exports = fetchObservable; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48354
1036