mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
cleanup leftovers such as mode and pyodideReadyPromise (#649)
* remove usage of mode * clean up pyodideReadyPromise
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user