mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 18:55:29 -05:00
Use async/await instead of promise chaining (#266)
* Use async/await instead of promise chaining * Await asynchronous operations
This commit is contained in:
@@ -41,12 +41,10 @@ export class PyInputBox extends BaseEvalElement {
|
||||
|
||||
// TODO: For now we delay execution to allow pyodide to load but in the future this
|
||||
// should really wait for it to load..
|
||||
setTimeout(() => {
|
||||
this.eval(this.code).then(() => {
|
||||
this.eval(registrationCode).then(() => {
|
||||
console.log('registered handlers');
|
||||
});
|
||||
});
|
||||
setTimeout(async () => {
|
||||
await this.eval(this.code);
|
||||
await this.eval(registrationCode);
|
||||
console.log('registered handlers');
|
||||
}, 4000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user