support for execution of async functions + integration with backend through server.exec()

This commit is contained in:
azivner
2018-01-23 21:59:30 -05:00
parent 27cb6b1c4d
commit f439969962
4 changed files with 32 additions and 3 deletions

View File

@@ -29,6 +29,14 @@ const server = (function() {
return await call('DELETE', url);
}
async function exec(script) {
if (typeof script === "function") {
script = script.toString();
}
return await post('script/exec', { script: script });
}
let i = 1;
const reqResolves = {};
@@ -92,6 +100,6 @@ const server = (function() {
post,
put,
remove,
getHeaders
exec
}
})();