wokwi / avr8js

Arduino (8-bit AVR) simulator, written in JavaScript and runs in the browser / Node.js
https://blog.wokwi.com/avr8js-simulate-arduino-in-javascript/
MIT License
463 stars 73 forks source link

Editor UX - Save user history to localStorage on emulation run #24

Closed LironHazan closed 4 years ago

LironHazan commented 4 years ago

It will improve development experience if we'll save the cpp code every time the user hits "run simulation".

I suggest adding a tiny util which abstracts (safely) the localStorage.addItem and localStorage.removeItem. state machine: check if there's a localstorage entry: yes: remove it and add a new one. No: add one.

** see TS playground as a reference.

urish commented 4 years ago

It's worth adding a "Revert code" button (or similar) that removes the localStorage code and loads again the initial sample code

LironHazan commented 4 years ago

@urish will do