Skip to content

Don't mutate the actual state object. #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
<option value="pin_logo">Pin logo</option>
<option value="radio">Radio</option>
<option value="sensors">Sensors</option>
<option value="sound_effects_builtin">Sound effects (builtin)</option>
<option value="sound_effects_builtin">
Sound effects (builtin)
</option>
<option value="sound_effects_user">Sound effects (user)</option>
<option value="speech">Speech</option>
<option value="volume">Volume</option>
Expand Down Expand Up @@ -319,9 +321,10 @@ <h1>MicroPython-micro:bit simulator example embedding</h1>
const labelElt = document.createElement("label");
const text = labelElt.appendChild(document.createElement("span"));
text.innerText = info.type;
delete info.type;
const infoText = labelElt.appendChild(document.createElement("code"));
infoText.innerText = JSON.stringify(info);
const infoMutable = { ...info };
delete infoMutable.type;
infoText.innerText = JSON.stringify(infoMutable);
return labelElt;
};

Expand Down