8000 Change let to const; Minor code improvement (#300) · sarvjeetdev/pyscript@2526d24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2526d24

Browse files
authored
Change let to const; Minor code improvement (pyscript#300)
* Change let to const; Minor code improvement * Indentation fix
1 parent 71319d0 commit 2526d24

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

pyscriptjs/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
loader.log("Loading runtime...")
2727
pyodideReadyPromise = loadInterpreter();
2828
const pyodide = await pyodideReadyPromise;
29-
let newEnv = {
29+
const newEnv = {
3030
id: 'a',
3131
promise: pyodideReadyPromise,
3232
runtime: pyodide,

pyscriptjs/src/components/pyscript.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ async function mountElements() {
170170

171171
let source = '';
172172
for (const el of matches) {
173-
let mountName = el.getAttribute('py-mount');
174-
if (!mountName) {
175-
mountName = el.id.split('-').join('_');
176-
}
173+
const mountName = el.getAttribute('py-mount') || el.id.split('-').join('_');
177174
source += `\n${mountName} = Element("${el.id}")`;
178175
}
179176
await pyodide.runPythonAsync(source);

0 commit comments

Comments
 (0)
0