Change let to const; Minor code improvement (#300)

* Change let to const; Minor code improvement

* Indentation fix
This commit is contained in:
ic-768
2022-05-10 21:15:32 +00:00
committed by GitHub
parent 71319d0969
commit 2526d242bc
2 changed files with 2 additions and 5 deletions

View File

@@ -26,7 +26,7 @@
loader.log("Loading runtime...")
pyodideReadyPromise = loadInterpreter();
const pyodide = await pyodideReadyPromise;
let newEnv = {
const newEnv = {
id: 'a',
promise: pyodideReadyPromise,
runtime: pyodide,

View File

@@ -170,10 +170,7 @@ async function mountElements() {
let source = '';
for (const el of matches) {
let mountName = el.getAttribute('py-mount');
if (!mountName) {
mountName = el.id.split('-').join('_');
}
const mountName = el.getAttribute('py-mount') || el.id.split('-').join('_');
source += `\n${mountName} = Element("${el.id}")`;
}
await pyodide.runPythonAsync(source);