Skip to content
Snippets Groups Projects
Commit bcd6a598 authored by Markin Igor's avatar Markin Igor
Browse files

Update client to use Promises instead of async/await to avoid including babel-polyfill.

parent 1fed2a6c
No related branches found
No related tags found
1 merge request!4Use webpack for bundling JS libs and move Golang code related to Iframe generation there
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment