~/talk

Building a Time Machine with ES6 Proxies

Talkat DevWorld 2024 · 2024-02-29..03-01· [javascript]
slides:none on file

Shows how ES6 Proxies intercept get/set to implement automatic change saving and simple reactivity, and live codes a time machine/multiverse that records full-state snapshots and exposes forward/back and jump-to-time controls. Implementation uses structuredClone and pushes entire states (cheap to implement, heavy on memory), creates timelines when jumping, and wires DOM updates via an onUpdate callback. Caveats: nested objects/arrays need more proxying, and actions in the past do not change existing futures.

AI-written summary · about

  1. 0:00JavaScript Proxies intro
  2. 1:00Introduction
  3. 2:05What are Proxies
  4. 3:31Time machine concept
  5. 5:17Live coding setup
  6. 6:01Proxy getters/setters
  7. 7:29Proxy traps
  8. 10:40Time machine function
  9. 12:04Reactivity with proxies
  10. 14:53Saving states
  11. 17:43UI state display
  12. 19:10Adding forward and backward navigation
  13. 21:18Introducing the role-playing game demo
  14. 22:26Game structure
  15. 23:53Time travel in game
  16. 26:01Resolving demo issues and final walkthrough
  17. 27:50Game demo
  18. 28:36Limitations
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.