cleanup leftovers such as mode and pyodideReadyPromise (#649)

* remove usage of mode

* clean up pyodideReadyPromise
This commit is contained in:
Madhur Tandon
2022-08-02 20:44:41 +05:30
committed by GitHub
parent a4839db79a
commit 006d161a32
4 changed files with 7 additions and 31 deletions

View File

@@ -3,7 +3,6 @@ import {
addPostInitializer,
addToScriptsQueue,
loadedEnvironments,
mode,
pyodideLoaded,
type Environment,
} from '../stores';
@@ -12,9 +11,8 @@ import { BaseEvalElement } from './base';
import type { PyodideInterface } from '../pyodide';
// Premise used to connect to the first available pyodide interpreter
let pyodideReadyPromise;
let pyodideReadyPromise: PyodideInterface;
let environments: Record<Environment['id'], Environment> = {};
let currentMode;
pyodideLoaded.subscribe(value => {
pyodideReadyPromise = value;
@@ -23,10 +21,6 @@ loadedEnvironments.subscribe(value => {
environments = value;
});
mode.subscribe(value => {
currentMode = value;
});
export class PyScript extends BaseEvalElement {
constructor() {
super();
@@ -74,13 +68,8 @@ export class PyScript extends BaseEvalElement {
}
}
if (currentMode == 'edit') {
// TODO: We need to build a plan for this
this.appendChild(mainDiv);
} else {
this.appendChild(mainDiv);
addToScriptsQueue(this);
}
this.appendChild(mainDiv);
addToScriptsQueue(this);
console.log('connected');