@rematch/loading
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var 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++)for(var r in t=arguments[n])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,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,l)}s((o=o.apply(e,t||[])).next())})},r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=o[2&a[0]?"return":a[0]?"throw":"next"])&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[0,r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&r[3]>a[1])){i.label=a[1];break}if(6===a[0]&&r[1]>i.label){i.label=r[1],r=a;break}if(r&&r[2]>i.label){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(t,"__esModule",{value:!0});var a={global:0,models:{},effects:{}},i=function(e,t){return function(o,r){var i,l,s,c=r.name,u=r.action;return a.global+=t,a.models[c]+=t,a.effects[c][u]+=t,n({},o,{global:e(a.global),models:n({},o.models,(i={},i[c]=e(a.models[c]),i)),effects:n({},o.effects,(l={},l[c]=n({},o.effects[c],(s={},s[u]=e(a.effects[c][u]),s)),l))})}};t.default=function(e){void 0===e&&(e={}),function(e){if(e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.asNumber&&"boolean"!=typeof e.asNumber)throw Error("loading plugin config asNumber must be a boolean");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")}(e);var t=e.name||"loading",l=!0===e.asNumber?function(e){return e}:function(e){return e>0},s={name:t,reducers:{hide:i(l,-1),show:i(l,1)},state:n({},a)};return a.global=0,s.state.global=l(a.global),{config:{models:{loading:s}},onModel:function(n){var i=this,c=n.name;c!==t&&(a.models[c]=0,s.state.models[c]=l(a.models[c]),s.state.effects[c]={},Object.keys(this.dispatch[c]).forEach(function(t){if(!0===i.dispatch[c][t].isEffect){a.effects[c][t]=0,s.state.effects[c][t]=l(a.effects[c][t]);var n=c+"/"+t;if((!e.whitelist||e.whitelist.includes(n))&&(!e.blacklist||!e.blacklist.includes(n))){var u=i.dispatch[c][t];i.dispatch[c][t]=function(){for(var e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return o(i,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return n.trys.push([0,,2,3]),this.dispatch.loading.show({name:c,action:t}),[4,u.apply(void 0,e)];case 1:return n.sent(),[3,3];case 2:return this.dispatch.loading.hide({name:c,action:t}),[7];case 3:return[2]}})})}}}}))}}}}),index=unwrapExports(lib);exports.default=index; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var 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++)for(var r in t=arguments[n])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,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,l)}s((o=o.apply(e,t||[])).next())})},r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=o[2&a[0]?"return":a[0]?"throw":"next"])&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[0,r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&r[3]>a[1])){i.label=a[1];break}if(6===a[0]&&r[1]>i.label){i.label=r[1],r=a;break}if(r&&r[2]>i.label){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(t,"__esModule",{value:!0});var a={global:0,models:{},effects:{}},i=function(e,t){return function(o,r){var i,l,s,c=r.name,u=r.action;return a.global+=t,a.models[c]+=t,a.effects[c][u]+=t,n({},o,{global:e(a.global),models:n({},o.models,(i={},i[c]=e(a.models[c]),i)),effects:n({},o.effects,(l={},l[c]=n({},o.effects[c],(s={},s[u]=e(a.effects[c][u]),s)),l))})}};t.default=function(e){void 0===e&&(e={}),function(e){if(e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.asNumber&&"boolean"!=typeof e.asNumber)throw Error("loading plugin config asNumber must be a boolean");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")}(e);var t=e.name||"loading",l=!0===e.asNumber?function(e){return e}:function(e){return e>0},s={name:t,reducers:{hide:i(l,-1),show:i(l,1)},state:n({},a)};return a.global=0,s.state.global=l(a.global),{config:{models:{loading:s}},onModel:function(n){var i=this,c=n.name;c!==t&&(a.models[c]=0,s.state.models[c]=l(a.models[c]),s.state.effects[c]={},Object.keys(this.dispatch[c]).forEach(function(t){if(!0===i.dispatch[c][t].isEffect){a.effects[c][t]=0,s.state.effects[c][t]=l(a.effects[c][t]);var n=c+"/"+t;if((!e.whitelist||e.whitelist.includes(n))&&(!e.blacklist||!e.blacklist.includes(n))){var u=i.dispatch[c][t];i.dispatch[c][t]=function(){for(var e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return o(i,void 0,void 0,function(){var n;return r(this,function(o){switch(o.label){case 0:return o.trys.push([0,,2,3]),this.dispatch.loading.show({name:c,action:t}),[4,u.apply(void 0,e)];case 1:return n=o.sent(),[3,3];case 2:return this.dispatch.loading.hide({name:c,action:t}),[2,n];case 3:return[2]}})})}}}}))}}}}),index=unwrapExports(lib);exports.default=index; | ||
//# sourceMappingURL=rematch-loading.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var 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++)for(var r in t=arguments[n])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,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,l)}s((o=o.apply(e,t||[])).next())})},r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=o[2&a[0]?"return":a[0]?"throw":"next"])&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[0,r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&r[3]>a[1])){i.label=a[1];break}if(6===a[0]&&r[1]>i.label){i.label=r[1],r=a;break}if(r&&r[2]>i.label){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(t,"__esModule",{value:!0});var a={global:0,models:{},effects:{}},i=function(e,t){return function(o,r){var i,l,s,c=r.name,f=r.action;return a.global+=t,a.models[c]+=t,a.effects[c][f]+=t,n({},o,{global:e(a.global),models:n({},o.models,(i={},i[c]=e(a.models[c]),i)),effects:n({},o.effects,(l={},l[c]=n({},o.effects[c],(s={},s[f]=e(a.effects[c][f]),s)),l))})}};t.default=function(e){void 0===e&&(e={}),function(e){if(e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.asNumber&&"boolean"!=typeof e.asNumber)throw Error("loading plugin config asNumber must be a boolean");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")}(e);var t=e.name||"loading",l=!0===e.asNumber?function(e){return e}:function(e){return e>0},s={name:t,reducers:{hide:i(l,-1),show:i(l,1)},state:n({},a)};return a.global=0,s.state.global=l(a.global),{config:{models:{loading:s}},onModel:function(n){var i=this,c=n.name;c!==t&&(a.models[c]=0,s.state.models[c]=l(a.models[c]),s.state.effects[c]={},Object.keys(this.dispatch[c]).forEach(function(t){if(!0===i.dispatch[c][t].isEffect){a.effects[c][t]=0,s.state.effects[c][t]=l(a.effects[c][t]);var n=c+"/"+t;if((!e.whitelist||e.whitelist.includes(n))&&(!e.blacklist||!e.blacklist.includes(n))){var f=i.dispatch[c][t];i.dispatch[c][t]=function(){for(var e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return o(i,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return n.trys.push([0,,2,3]),this.dispatch.loading.show({name:c,action:t}),[4,f.apply(void 0,e)];case 1:return n.sent(),[3,3];case 2:return this.dispatch.loading.hide({name:c,action:t}),[7];case 3:return[2]}})})}}}}))}}}}),index=unwrapExports(lib);export default index; | ||
var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var 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++)for(var r in t=arguments[n])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,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(i,l)}s((o=o.apply(e,t||[])).next())})},r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=o[2&a[0]?"return":a[0]?"throw":"next"])&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[0,r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&r[3]>a[1])){i.label=a[1];break}if(6===a[0]&&r[1]>i.label){i.label=r[1],r=a;break}if(r&&r[2]>i.label){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}};Object.defineProperty(t,"__esModule",{value:!0});var a={global:0,models:{},effects:{}},i=function(e,t){return function(o,r){var i,l,s,c=r.name,f=r.action;return a.global+=t,a.models[c]+=t,a.effects[c][f]+=t,n({},o,{global:e(a.global),models:n({},o.models,(i={},i[c]=e(a.models[c]),i)),effects:n({},o.effects,(l={},l[c]=n({},o.effects[c],(s={},s[f]=e(a.effects[c][f]),s)),l))})}};t.default=function(e){void 0===e&&(e={}),function(e){if(e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.asNumber&&"boolean"!=typeof e.asNumber)throw Error("loading plugin config asNumber must be a boolean");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")}(e);var t=e.name||"loading",l=!0===e.asNumber?function(e){return e}:function(e){return e>0},s={name:t,reducers:{hide:i(l,-1),show:i(l,1)},state:n({},a)};return a.global=0,s.state.global=l(a.global),{config:{models:{loading:s}},onModel:function(n){var i=this,c=n.name;c!==t&&(a.models[c]=0,s.state.models[c]=l(a.models[c]),s.state.effects[c]={},Object.keys(this.dispatch[c]).forEach(function(t){if(!0===i.dispatch[c][t].isEffect){a.effects[c][t]=0,s.state.effects[c][t]=l(a.effects[c][t]);var n=c+"/"+t;if((!e.whitelist||e.whitelist.includes(n))&&(!e.blacklist||!e.blacklist.includes(n))){var f=i.dispatch[c][t];i.dispatch[c][t]=function(){for(var e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return o(i,void 0,void 0,function(){var n;return r(this,function(o){switch(o.label){case 0:return o.trys.push([0,,2,3]),this.dispatch.loading.show({name:c,action:t}),[4,f.apply(void 0,e)];case 1:return n=o.sent(),[3,3];case 2:return this.dispatch.loading.hide({name:c,action:t}),[2,n];case 3:return[2]}})})}}}}))}}}}),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:{};var n,o,r=(function(e,n){var o=t&&t.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;o>n;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r=t&&t.__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())})},i=t&&t.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=o[2&i[0]?"return":i[0]?"throw":"next"])&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[0,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&r[3]>i[1])){a.label=i[1];break}if(6===i[0]&&r[1]>a.label){a.label=r[1],r=i;break}if(r&&r[2]>a.label){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};Object.defineProperty(n,"__esModule",{value:!0});var a={global:0,models:{},effects:{}},l=function(e,t){return function(n,r){var i,l,s,f=r.name,c=r.action;return a.global+=t,a.models[f]+=t,a.effects[f][c]+=t,o({},n,{global:e(a.global),models:o({},n.models,(i={},i[f]=e(a.models[f]),i)),effects:o({},n.effects,(l={},l[f]=o({},n.effects[f],(s={},s[c]=e(a.effects[f][c]),s)),l))})}};n.default=function(e){void 0===e&&(e={}),function(e){if(e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.asNumber&&"boolean"!=typeof e.asNumber)throw Error("loading plugin config asNumber must be a boolean");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")}(e);var t=e.name||"loading",n=!0===e.asNumber?function(e){return e}:function(e){return e>0},s={name:t,reducers:{hide:l(n,-1),show:l(n,1)},state:o({},a)};return a.global=0,s.state.global=n(a.global),{config:{models:{loading:s}},onModel:function(o){var l=this,f=o.name;f!==t&&(a.models[f]=0,s.state.models[f]=n(a.models[f]),s.state.effects[f]={},Object.keys(this.dispatch[f]).forEach(function(t){if(!0===l.dispatch[f][t].isEffect){a.effects[f][t]=0,s.state.effects[f][t]=n(a.effects[f][t]);var o=f+"/"+t;if((!e.whitelist||e.whitelist.includes(o))&&(!e.blacklist||!e.blacklist.includes(o))){var c=l.dispatch[f][t];l.dispatch[f][t]=function(){for(var e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return r(l,void 0,void 0,function(){return i(this,function(n){switch(n.label){case 0:return n.trys.push([0,,2,3]),this.dispatch.loading.show({name:f,action:t}),[4,c.apply(void 0,e)];case 1:return n.sent(),[3,3];case 2:return this.dispatch.loading.hide({name:f,action:t}),[7];case 3:return[2]}})})}}}}))}}}}(n={exports:{}},n.exports),n.exports),i=(o=r)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;e.default=i,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:{};var n,o,r=(function(e,n){var o=t&&t.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;o>n;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r=t&&t.__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())})},i=t&&t.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=o[2&i[0]?"return":i[0]?"throw":"next"])&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[0,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&r[3]>i[1])){a.label=i[1];break}if(6===i[0]&&r[1]>a.label){a.label=r[1],r=i;break}if(r&&r[2]>a.label){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};Object.defineProperty(n,"__esModule",{value:!0});var a={global:0,models:{},effects:{}},l=function(e,t){return function(n,r){var i,l,s,f=r.name,c=r.action;return a.global+=t,a.models[f]+=t,a.effects[f][c]+=t,o({},n,{global:e(a.global),models:o({},n.models,(i={},i[f]=e(a.models[f]),i)),effects:o({},n.effects,(l={},l[f]=o({},n.effects[f],(s={},s[c]=e(a.effects[f][c]),s)),l))})}};n.default=function(e){void 0===e&&(e={}),function(e){if(e.name&&"string"!=typeof e.name)throw Error("loading plugin config name must be a string");if(e.asNumber&&"boolean"!=typeof e.asNumber)throw Error("loading plugin config asNumber must be a boolean");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")}(e);var t=e.name||"loading",n=!0===e.asNumber?function(e){return e}:function(e){return e>0},s={name:t,reducers:{hide:l(n,-1),show:l(n,1)},state:o({},a)};return a.global=0,s.state.global=n(a.global),{config:{models:{loading:s}},onModel:function(o){var l=this,f=o.name;f!==t&&(a.models[f]=0,s.state.models[f]=n(a.models[f]),s.state.effects[f]={},Object.keys(this.dispatch[f]).forEach(function(t){if(!0===l.dispatch[f][t].isEffect){a.effects[f][t]=0,s.state.effects[f][t]=n(a.effects[f][t]);var o=f+"/"+t;if((!e.whitelist||e.whitelist.includes(o))&&(!e.blacklist||!e.blacklist.includes(o))){var c=l.dispatch[f][t];l.dispatch[f][t]=function(){for(var e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return r(l,void 0,void 0,function(){var n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,,2,3]),this.dispatch.loading.show({name:f,action:t}),[4,c.apply(void 0,e)];case 1:return n=o.sent(),[3,3];case 2:return this.dispatch.loading.hide({name:f,action:t}),[2,n];case 3:return[2]}})})}}}}))}}}}(n={exports:{}},n.exports),n.exports),i=(o=r)&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;e.default=i,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=rematch-loading.umd.js.map |
{ | ||
"name": "@rematch/loading", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Loading indicator plugin for Rematch", | ||
@@ -38,4 +38,4 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@rematch/core": ">=1.0.0-alpha.0" | ||
"@rematch/core": ">=1.0.0-alpha.3" | ||
} | ||
} |
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
59030