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
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
......@@ -8,7 +8,7 @@ const Penpal = require('penpal').default;
* @param apiUrl - API URL used to access API endpoints
* @returns {*}
*/
async function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
if (!apiUrl) {
return Promise.reject('API Host not specified.')
}
......@@ -22,10 +22,8 @@ async function setupViamAPI(divId, methods, iframeUrl, apiUrl) {
methods
});
const child = await connection.promise;
await child.initializeApiHost(apiUrl);
return child;
return connection.promise
.then((child) => child.initializeApiHost(apiUrl).then(() => child))
}
window.setupViamAPI = setupViamAPI;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment