UNPKG

@msw-devtools/connect

Version:
3 lines (2 loc) 873 B
var n=require("msw"),e=function(e){var _=e.requestId,i=e.request;return new Promise(function(e,E){var o;null!=(o=window.__MSW_DEVTOOLS_EXTENSION)&&o.resolve?window.__MSW_DEVTOOLS_EXTENSION.resolve({requestId:_,request:i}).then(function(_){e(new n.HttpResponse(_.body,_.init))}).catch(function(){e(n.passthrough())}):e(n.passthrough())})};exports.createResponseResolver=function(){return window.__MSW_DEVTOOLS_EXTENSION||(window.__MSW_DEVTOOLS_EXTENSION_QUEUE||(window.__MSW_DEVTOOLS_EXTENSION_QUEUE=[]),window.__MSW_DEVTOOLS_EXTENSION={handleInitialized:function(){var n;null==(n=window.__MSW_DEVTOOLS_EXTENSION_QUEUE)||n.push(function(){var n;null==(n=window.__MSW_DEVTOOLS_EXTENSION)||n.handleInitialized()})},resolve:function(){return Promise.reject("Handle not initialized")}}),window.__MSW_DEVTOOLS_EXTENSION.handleInitialized(),e}; //# sourceMappingURL=index.cjs.map