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() {
|
connectedCallback() {
|
||||||
console.log(this.name, 'OOOOOOO connected!!!!')
|
// TODO: we are calling with a 2secs delay to allow pyodide to load
|
||||||
this.eval(this.code).then(() => {
|
// ideally we can just wait for it to load and then run. To do
|
||||||
this.proxy = this.proxyClass(this);
|
// so we need to replace using the promise and actually using
|
||||||
console.log('proxy', this.proxy);
|
// the interpreter after it loads completely
|
||||||
this.proxy.connect();
|
setTimeout(() => {
|
||||||
this.registerWidget();
|
this.eval(this.code).then(() => {
|
||||||
});
|
this.proxy = this.proxyClass(this);
|
||||||
console.log(this.name, 'DOOOOONE connected!!!!')
|
console.log('proxy', this.proxy);
|
||||||
|
this.proxy.connect();
|
||||||
|
this.registerWidget();
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async registerWidget(){
|
async registerWidget(){
|
||||||
|
|||||||
Reference in New Issue
Block a user