Skip to content
Snippets Groups Projects

Set up libraries building as static files

Merged Igor Markin requested to merge feature-move-js-libs-to-vcl into master
1 file
+ 13
13
Compare changes
  • Side-by-side
  • Inline
@@ -9,21 +9,21 @@ const Penpal = require('penpal').default;
* @returns {*}
*/
function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
if (!apiUrl) {
return Promise.reject('API Host not specified.')
}
if (!apiUrl) {
return Promise.reject('API Host not specified.');
}
const connection = Penpal.connectToChild({
// URL of page to load into iframe.
url: iframeUrl,
// Container to which the iframe should be appended.
appendTo: document.getElementById(divId),
// Methods parent is exposing to child
methods
});
const connection = Penpal.connectToChild({
// URL of page to load into iframe.
url: iframeUrl,
// Container to which the iframe should be appended.
appendTo: document.getElementById(divId),
// Methods parent is exposing to child
methods
});
return connection.promise
.then((child) => child.initializeApiHost(apiUrl).then(() => child))
return connection.promise
.then((child) => child.initializeApiHost(apiUrl).then(() => child));
}
window.setupViamAPI = setupViamAPI;
Loading