@rematch/loading
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -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++){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,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=function(e){return function(t,o){var r,a,i,l=o.name;return n({},t,{effects:n({},t.effects,(r={},r[l]=n({},t.effects[l],(a={},a[o.action]=e,a)),r)),global:e,models:n({},t.models,(i={},i[l]=e,i))})}};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:a(!1),show:a(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(a){var i=a.dispatch;return{onModel:function(a){var l=this,s=a.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(i[s]).forEach(function(t){if(i[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 a=i[s][t];i[s][t]=function(e){return o(l,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),i.loading.show({name:s,action:t}),[4,a(e)];case 1:case 2:return n.sent(),i.loading.hide({name:s,action:t}),[3,3];case 3:return[2]}})})}}else n.state.models[s]=!1}))}}}}}}),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=function(e){return function(t,o){var r,a,i,l=o.name;return n({},t,{effects:n({},t.effects,(r={},r[l]=n({},t.effects[l],(a={},a[o.action]=e,a)),r)),global:e,models:n({},t.models,(i={},i[l]=e,i))})}};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:a(!1),show:a(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(a){var i=a.dispatch;return{onModel:function(a){var l=this,s=a.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(i[s]).forEach(function(t){if(i[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 a=i[s][t];i[s][t]=function(e){return o(l,void 0,void 0,function(){var n;return r(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),i.loading.show({name:s,action:t}),[4,a(e)];case 1:return o.sent(),i.loading.hide({name:s,action:t}),[3,4];case 2:return n=o.sent(),[4,i.loading.hide({name:s,action:t})];case 3:throw o.sent(),n;case 4:return[2]}})})}}else n.state.models[s]=!1}))}}}}}}),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++){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,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=function(e){return function(t,o){var r,a,i,l=o.name;return n({},t,{effects:n({},t.effects,(r={},r[l]=n({},t.effects[l],(a={},a[o.action]=e,a)),r)),global:e,models:n({},t.models,(i={},i[l]=e,i))})}};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:a(!1),show:a(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(a){var i=a.dispatch;return{onModel:function(a){var l=this,s=a.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(i[s]).forEach(function(t){if(i[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 a=i[s][t];i[s][t]=function(e){return o(l,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),i.loading.show({name:s,action:t}),[4,a(e)];case 1:case 2:return n.sent(),i.loading.hide({name:s,action:t}),[3,3];case 3:return[2]}})})}}else n.state.models[s]=!1}))}}}}}}),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=function(e){return function(t,o){var r,a,i,l=o.name;return n({},t,{effects:n({},t.effects,(r={},r[l]=n({},t.effects[l],(a={},a[o.action]=e,a)),r)),global:e,models:n({},t.models,(i={},i[l]=e,i))})}};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:a(!1),show:a(!0)},state:{effects:{},global:!1,models:{}}};return{config:{models:{loading:n}},init:function(a){var i=a.dispatch;return{onModel:function(a){var l=this,s=a.name;s!==t&&(n.state.models[s]=!1,n.state.effects[s]={},Object.keys(i[s]).forEach(function(t){if(i[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 a=i[s][t];i[s][t]=function(e){return o(l,void 0,void 0,function(){var n;return r(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),i.loading.show({name:s,action:t}),[4,a(e)];case 1:return o.sent(),i.loading.hide({name:s,action:t}),[3,4];case 2:return n=o.sent(),[4,i.loading.hide({name:s,action:t})];case 3:throw o.sent(),n;case 4:return[2]}})})}}else n.state.models[s]=!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:{};var n,r,o=(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){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[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,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&o[3]>i[1])){a.label=i[1];break}if(6===i[0]&&o[1]>a.label){a.label=o[1],o=i;break}if(o&&o[2]>a.label){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=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=function(e){return function(t,n){var o,i,a,l=n.name;return r({},t,{effects:r({},t.effects,(o={},o[l]=r({},t.effects[l],(i={},i[n.action]=e,i)),o)),global:e,models:r({},t.models,(a={},a[l]=e,a))})}};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 n.trys.push([0,2,,3]),a.loading.show({name:s,action:t}),[4,r(e)];case 1:case 2:return n.sent(),a.loading.hide({name:s,action:t}),[3,3];case 3:return[2]}})})}}else n.state.models[s]=!1}))}}}}}}(n={exports:{}},n.exports),n.exports),i=(r=o)&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;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,r,o=(function(e,n){var r=t&&t.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;r>n;n++)for(var o in t=arguments[n])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){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[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,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&o[3]>i[1])){a.label=i[1];break}if(6===i[0]&&o[1]>a.label){a.label=o[1],o=i;break}if(o&&o[2]>a.label){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=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=function(e){return function(t,n){var o,i,a,l=n.name;return r({},t,{effects:r({},t.effects,(o={},o[l]=r({},t.effects[l],(i={},i[n.action]=e,i)),o)),global:e,models:r({},t.models,(a={},a[l]=e,a))})}};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(){var n;return i(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),a.loading.show({name:s,action:t}),[4,r(e)];case 1:return o.sent(),a.loading.hide({name:s,action:t}),[3,4];case 2:return n=o.sent(),[4,a.loading.hide({name:s,action:t})];case 3:throw o.sent(),n;case 4:return[2]}})})}}else n.state.models[s]=!1}))}}}}}}(n={exports:{}},n.exports),n.exports),i=(r=o)&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;e.default=i,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=rematch-loading.umd.js.map |
{ | ||
"name": "@rematch/loading", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Loading indicator plugin for Rematch", | ||
@@ -28,7 +28,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"@rematch/core": "^0.3.0" | ||
"@rematch/core": "^0.4.1" | ||
}, | ||
"peerDependencies": { | ||
"@rematch/core": ">0.1.3" | ||
"@rematch/core": ">0.4" | ||
} | ||
} |
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
51837