mirror of
https://github.com/pyscript/pyscript.git
synced 2022-05-01 19:47:48 +03:00
add timer to register generic widgets
This commit is contained in:
@@ -192,14 +192,18 @@ export class BaseEvalElement extends HTMLElement {
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
console.log(this.name, 'OOOOOOO connected!!!!')
|
||||
this.eval(this.code).then(() => {
|
||||
this.proxy = this.proxyClass(this);
|
||||
console.log('proxy', this.proxy);
|
||||
this.proxy.connect();
|
||||
this.registerWidget();
|
||||
});
|
||||
console.log(this.name, 'DOOOOONE connected!!!!')
|
||||
// TODO: we are calling with a 2secs delay to allow pyodide to load
|
||||
// ideally we can just wait for it to load and then run. To do
|
||||
// so we need to replace using the promise and actually using
|
||||
// the interpreter after it loads completely
|
||||
setTimeout(() => {
|
||||
this.eval(this.code).then(() => {
|
||||
this.proxy = this.proxyClass(this);
|
||||
console.log('proxy', this.proxy);
|
||||
this.proxy.connect();
|
||||
this.registerWidget();
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
async registerWidget(){
|
||||
|
||||
Reference in New Issue
Block a user