UNPKG

reactotron-react-native

Version:

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

32 lines (31 loc) 710 B
"use strict"; 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) }); } }; }; export default openInEditor; //# sourceMappingURL=openInEditor.js.map