@rematch/loading
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1,2 +0,2 @@ | ||
"use strict";function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lib=createCommonjsModule(function(e,t){var n=commonjsGlobal&&commonjsGlobal.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;o>n;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((o=o.apply(e,t||[])).next())})},r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){function n(n){return function(a){return function(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(i=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(i=i.call(r,n[1])).done)return i;switch(r=0,i&&(n=[0,i.value]),n[0]){case 0:case 1:i=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,r=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(i=l.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&i[3]>n[1])){l.label=n[1];break}if(6===n[0]&&i[1]>l.label){l.label=i[1],i=n;break}if(i&&i[2]>l.label){l.label=i[2],l.ops.push(n);break}i[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],r=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}var o,r,i,a,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return function(t,o){var r=o.name;return n({},t,{effects:n({},t.effects,(i={},i[r]=n({},t.effects[r],(a={},a[o.action]=e,a)),i)),global:e,models:n({},t.models,(l={},l[r]=e,l))});var i,a,l}};t.default=function(e){if(void 0===e&&(e={}),e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.whitelist&&!Array.isArray(e.whitelist))throw Error("loading plugin config whitelist must be an array of strings");if(e.blacklist&&!Array.isArray(e.blacklist))throw Error("loading plugin config blacklist must be an array of strings");if(e.whitelist&&e.blacklist)throw Error("loading plugin config cannot have both a whitelist & a blacklist");var t=e.name||"loading",n={name:t,reducers:{hide:i(!1),show:i(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(i){var a=i.dispatch;return{onModel:function(i){var l=this,s=i.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(a[s]).forEach(function(t){if(a[s][t].isEffect){if(e.whitelist&&!e.whitelist.includes(s+"/"+t))return;if(e.blacklist&&e.blacklist.includes(s+"/"+t))return;n.state.effects[s][t]=!1;var i=a[s][t];a[s][t]=function(e){return o(l,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return a.loading.show({name:s,action:t}),[4,i(e)];case 1:return n.sent(),a.loading.hide({name:s,action:t}),[2]}})})}}else n.state.models[s]=!1}))}}}}}}),index=unwrapExports(lib);exports.default=index; | ||
"use strict";function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lib=createCommonjsModule(function(e,t){var n=commonjsGlobal&&commonjsGlobal.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;o>n;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){return function(t,o){var i=o.name;return n({},t,{effects:n({},t.effects,(r={},r[i]=n({},t.effects[i],(a={},a[o.action]=e,a)),r)),global:e,models:n({},t.models,(l={},l[i]=e,l))});var r,a,l}};t.default=function(e){if(void 0===e&&(e={}),e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.whitelist&&!Array.isArray(e.whitelist))throw Error("loading plugin config whitelist must be an array of strings");if(e.blacklist&&!Array.isArray(e.blacklist))throw Error("loading plugin config blacklist must be an array of strings");if(e.whitelist&&e.blacklist)throw Error("loading plugin config cannot have both a whitelist & a blacklist");var t=e.name||"loading",n={name:t,reducers:{hide:o(!1),show:o(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(o){var i=o.dispatch;return{onModel:function(o){var r=o.name;r!==t&&(n.state.models[r]=!1,n.state.effects[r]={},Object.keys(i[r]).forEach(function(t){if(i[r][t].isEffect){if(e.whitelist&&!e.whitelist.includes(r+"/"+t))return;if(e.blacklist&&e.blacklist.includes(r+"/"+t))return;n.state.effects[r][t]=!1;var o=i[r][t];i[r][t]=function(e){return i.loading.show({name:r,action:t}),o(e).catch(function(){return i.loading.hide({name:r,action:t})}).then(function(){return i.loading.hide({name:r,action:t})})}}else n.state.models[r]=!1}))}}}}}}),index=unwrapExports(lib);exports.default=index; | ||
//# sourceMappingURL=rematch-loading.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lib=createCommonjsModule(function(e,t){var n=commonjsGlobal&&commonjsGlobal.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;o>n;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o=commonjsGlobal&&commonjsGlobal.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,l)}s((o=o.apply(e,t||[])).next())})},r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){function n(n){return function(a){return function(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(i=r[2&n[0]?"return":n[0]?"throw":"next"])&&!(i=i.call(r,n[1])).done)return i;switch(r=0,i&&(n=[0,i.value]),n[0]){case 0:case 1:i=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,r=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(i=l.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&i[3]>n[1])){l.label=n[1];break}if(6===n[0]&&i[1]>l.label){l.label=i[1],i=n;break}if(i&&i[2]>l.label){l.label=i[2],l.ops.push(n);break}i[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],r=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}var o,r,i,a,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return function(t,o){var r=o.name;return n({},t,{effects:n({},t.effects,(i={},i[r]=n({},t.effects[r],(a={},a[o.action]=e,a)),i)),global:e,models:n({},t.models,(l={},l[r]=e,l))});var i,a,l}};t.default=function(e){if(void 0===e&&(e={}),e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.whitelist&&!Array.isArray(e.whitelist))throw Error("loading plugin config whitelist must be an array of strings");if(e.blacklist&&!Array.isArray(e.blacklist))throw Error("loading plugin config blacklist must be an array of strings");if(e.whitelist&&e.blacklist)throw Error("loading plugin config cannot have both a whitelist & a blacklist");var t=e.name||"loading",n={name:t,reducers:{hide:i(!1),show:i(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(i){var a=i.dispatch;return{onModel:function(i){var l=this,s=i.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(a[s]).forEach(function(t){if(a[s][t].isEffect){if(e.whitelist&&!e.whitelist.includes(s+"/"+t))return;if(e.blacklist&&e.blacklist.includes(s+"/"+t))return;n.state.effects[s][t]=!1;var i=a[s][t];a[s][t]=function(e){return o(l,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return a.loading.show({name:s,action:t}),[4,i(e)];case 1:return n.sent(),a.loading.hide({name:s,action:t}),[2]}})})}}else n.state.models[s]=!1}))}}}}}}),index=unwrapExports(lib);export default index; | ||
function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lib=createCommonjsModule(function(e,t){var n=commonjsGlobal&&commonjsGlobal.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;o>n;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e};Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){return function(t,o){var i=o.name;return n({},t,{effects:n({},t.effects,(r={},r[i]=n({},t.effects[i],(a={},a[o.action]=e,a)),r)),global:e,models:n({},t.models,(l={},l[i]=e,l))});var r,a,l}};t.default=function(e){if(void 0===e&&(e={}),e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.whitelist&&!Array.isArray(e.whitelist))throw Error("loading plugin config whitelist must be an array of strings");if(e.blacklist&&!Array.isArray(e.blacklist))throw Error("loading plugin config blacklist must be an array of strings");if(e.whitelist&&e.blacklist)throw Error("loading plugin config cannot have both a whitelist & a blacklist");var t=e.name||"loading",n={name:t,reducers:{hide:o(!1),show:o(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(o){var i=o.dispatch;return{onModel:function(o){var r=o.name;r!==t&&(n.state.models[r]=!1,n.state.effects[r]={},Object.keys(i[r]).forEach(function(t){if(i[r][t].isEffect){if(e.whitelist&&!e.whitelist.includes(r+"/"+t))return;if(e.blacklist&&e.blacklist.includes(r+"/"+t))return;n.state.effects[r][t]=!1;var o=i[r][t];i[r][t]=function(e){return i.loading.show({name:r,action:t}),o(e).catch(function(){return i.loading.hide({name:r,action:t})}).then(function(){return i.loading.hide({name:r,action:t})})}}else n.state.models[r]=!1}))}}}}}}),index=unwrapExports(lib);export default index; | ||
//# sourceMappingURL=rematch-loading.esm.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RematchLoading={})}(this,function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,n){var r=t&&t.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},o=t&&t.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,l)}s((r=r.apply(e,t||[])).next())})},i=t&&t.__generator||function(e,t){function n(n){return function(a){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,o&&(i=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[0,i.value]),n[0]){case 0:case 1:i=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,o=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(i=l.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&i[3]>n[1])){l.label=n[1];break}if(6===n[0]&&i[1]>l.label){l.label=i[1],i=n;break}if(i&&i[2]>l.label){l.label=i[2],l.ops.push(n);break}i[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],o=0}finally{r=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}var r,o,i,a,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(n,"__esModule",{value:!0});var a=function(e){return function(t,n){var o=n.name;return r({},t,{effects:r({},t.effects,(i={},i[o]=r({},t.effects[o],(a={},a[n.action]=e,a)),i)),global:e,models:r({},t.models,(l={},l[o]=e,l))});var i,a,l}};n.default=function(e){if(void 0===e&&(e={}),e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.whitelist&&!Array.isArray(e.whitelist))throw Error("loading plugin config whitelist must be an array of strings");if(e.blacklist&&!Array.isArray(e.blacklist))throw Error("loading plugin config blacklist must be an array of strings");if(e.whitelist&&e.blacklist)throw Error("loading plugin config cannot have both a whitelist & a blacklist");var t=e.name||"loading",n={name:t,reducers:{hide:a(!1),show:a(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(r){var a=r.dispatch;return{onModel:function(r){var l=this,s=r.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(a[s]).forEach(function(t){if(a[s][t].isEffect){if(e.whitelist&&!e.whitelist.includes(s+"/"+t))return;if(e.blacklist&&e.blacklist.includes(s+"/"+t))return;n.state.effects[s][t]=!1;var r=a[s][t];a[s][t]=function(e){return o(l,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return a.loading.show({name:s,action:t}),[4,r(e)];case 1:return n.sent(),a.loading.hide({name:s,action:t}),[2]}})})}}else n.state.models[s]=!1}))}}}}}}));e.default=n,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.RematchLoading={})}(this,function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,n){var i=t&&t.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;i>n;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(n,"__esModule",{value:!0});var o=function(e){return function(t,n){var o=n.name;return i({},t,{effects:i({},t.effects,(r={},r[o]=i({},t.effects[o],(a={},a[n.action]=e,a)),r)),global:e,models:i({},t.models,(s={},s[o]=e,s))});var r,a,s}};n.default=function(e){if(void 0===e&&(e={}),e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.whitelist&&!Array.isArray(e.whitelist))throw Error("loading plugin config whitelist must be an array of strings");if(e.blacklist&&!Array.isArray(e.blacklist))throw Error("loading plugin config blacklist must be an array of strings");if(e.whitelist&&e.blacklist)throw Error("loading plugin config cannot have both a whitelist & a blacklist");var t=e.name||"loading",n={name:t,reducers:{hide:o(!1),show:o(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(i){var o=i.dispatch;return{onModel:function(i){var r=i.name;r!==t&&(n.state.models[r]=!1,n.state.effects[r]={},Object.keys(o[r]).forEach(function(t){if(o[r][t].isEffect){if(e.whitelist&&!e.whitelist.includes(r+"/"+t))return;if(e.blacklist&&e.blacklist.includes(r+"/"+t))return;n.state.effects[r][t]=!1;var i=o[r][t];o[r][t]=function(e){return o.loading.show({name:r,action:t}),i(e).catch(function(){return o.loading.hide({name:r,action:t})}).then(function(){return o.loading.hide({name:r,action:t})})}}else n.state.models[r]=!1}))}}}}}}));e.default=n,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=rematch-loading.umd.js.map |
{ | ||
"name": "@rematch/loading", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Loading indicator plugin for Rematch", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
29239
28