UNPKG

@msw-devtools/connect

Version:
3 lines (2 loc) 1.06 kB
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("msw")):"function"==typeof define&&define.amd?define(["exports","msw"],n):n((e||self).connect={},e.msw)}(this,function(e,n){var i=function(e){var i=e.requestId,o=e.request;return new Promise(function(e,t){var _;null!=(_=window.__MSW_DEVTOOLS_EXTENSION)&&_.resolve?window.__MSW_DEVTOOLS_EXTENSION.resolve({requestId:i,request:o}).then(function(i){e(new n.HttpResponse(i.body,i.init))}).catch(function(){e(n.passthrough())}):e(n.passthrough())})};e.createResponseResolver=function(){return window.__MSW_DEVTOOLS_EXTENSION||(window.__MSW_DEVTOOLS_EXTENSION_QUEUE||(window.__MSW_DEVTOOLS_EXTENSION_QUEUE=[]),window.__MSW_DEVTOOLS_EXTENSION={handleInitialized:function(){var e;null==(e=window.__MSW_DEVTOOLS_EXTENSION_QUEUE)||e.push(function(){var e;null==(e=window.__MSW_DEVTOOLS_EXTENSION)||e.handleInitialized()})},resolve:function(){return Promise.reject("Handle not initialized")}}),window.__MSW_DEVTOOLS_EXTENSION.handleInitialized(),i}}); //# sourceMappingURL=index.umd.js.map