Skip to content
Snippets Groups Projects

Use webpack for bundling JS libs and move Golang code related to Iframe generation there

Merged Igor Markin requested to merge feature-vcl-webpack-bundle into master
1 file
+ 3
5
Compare changes
  • Side-by-side
  • Inline
@@ -8,7 +8,7 @@ const Penpal = require('penpal').default;
@@ -8,7 +8,7 @@ const Penpal = require('penpal').default;
* @param apiUrl - API URL used to access API endpoints
* @param apiUrl - API URL used to access API endpoints
* @returns {*}
* @returns {*}
*/
*/
async function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
if (!apiUrl) {
if (!apiUrl) {
return Promise.reject('API Host not specified.')
return Promise.reject('API Host not specified.')
}
}
@@ -22,10 +22,8 @@ async function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
@@ -22,10 +22,8 @@ async function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
methods
methods
});
});
const child = await connection.promise;
return connection.promise
await child.initializeApiHost(apiUrl);
.then((child) => child.initializeApiHost(apiUrl).then(() => child))
return child;
}
}
window.setupViamAPI = setupViamAPI;
window.setupViamAPI = setupViamAPI;
Loading