UNPKG

reactotron-react-native

Version:

A development tool to explore, inspect, and diagnose your React Native apps.

36 lines (35 loc) 819 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; const DEFAULTS = { url: "http://localhost:8081" }; const openInEditor = (pluginConfig = {}) => () => { const options = Object.assign({}, DEFAULTS, pluginConfig); return { onCommand: command => { if (command.type !== "editor.open") return; const { payload } = command; const { file, lineNumber } = payload; const url = `${options.url}/open-stack-frame`; const body = { file, lineNumber: lineNumber || 1 }; const method = "POST"; fetch(url, { method, body: JSON.stringify(body) }); } }; }; var _default = exports.default = openInEditor; //# sourceMappingURL=openInEditor.js.map