UNPKG

@msw-devtools/connect

Version:
3 lines (2 loc) 800 B
import{HttpResponse as _,passthrough as E}from"msw";const e=({requestId:e,request:i})=>new Promise((O,S)=>{var n;null!=(n=window.__MSW_DEVTOOLS_EXTENSION)&&n.resolve?window.__MSW_DEVTOOLS_EXTENSION.resolve({requestId:e,request:i}).then(E=>{O(new _(E.body,E.init))}).catch(()=>{O(E())}):O(E())}),i=()=>(window.__MSW_DEVTOOLS_EXTENSION||(window.__MSW_DEVTOOLS_EXTENSION_QUEUE||(window.__MSW_DEVTOOLS_EXTENSION_QUEUE=[]),window.__MSW_DEVTOOLS_EXTENSION={handleInitialized(){var _;null==(_=window.__MSW_DEVTOOLS_EXTENSION_QUEUE)||_.push(()=>{var _;null==(_=window.__MSW_DEVTOOLS_EXTENSION)||_.handleInitialized()})},resolve:()=>Promise.reject("Handle not initialized")}),window.__MSW_DEVTOOLS_EXTENSION.handleInitialized(),e);export{i as createResponseResolver}; //# sourceMappingURL=index.modern.js.map