Simple JavaScript state and undo/redo management | Dark Hacker News