UNPKG

probe.gl

Version:

JavaScript Console Instrumentation and Benchmarking for Browser and Node

18 lines (16 loc) 659 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.callExposedFunction = callExposedFunction; function callExposedFunction(exposedFunction, result) { if (window[exposedFunction]) { var resultString = JSON.stringify(result); console.error("Calling exposed function ".concat(exposedFunction, "(").concat(resultString, ")")); window[exposedFunction](resultString); } else { console.warn("window.".concat(exposedFunction, "() not yet exposed, waiting 1 second")); window.setTimeout(callExposedFunction.bind(null, exposedFunction, result), 1000); } } //# sourceMappingURL=call-exposed-function.js.map