~/talk

Composition API Best Practices

Talkat Vue.js Amsterdam 2020 · 2020-02-20..02-21· [vue]
slides:none on file

Argues practical rules: prefer refs by default for library consistency, wrap raw inputs so functions accept either a ref or a static value, and split big setup blocks into reusable composables. Demonstrates using watch with onCleanup to add and remove DOM listeners robustly and returning read-only computed or readonly objects to prevent external mutation. Cites real code (awesome.jsdf site is entirely Composition API) and shows these patterns are implemented and working at scale.

AI-written summary · about

  1. 0:00Start
  2. 6:36COMPUTED PROPERTIES ARE REFS
  3. 8:00DOM REFERENCES REQUIRE (TEMPLATE) REFS
  4. 9:20SO... ARE YOU TELLING ME THAT REACTIVE() IS USELESS?
  5. 10:23EMERGING BEST PRACTICES by example
  6. 15:26HANDLING REFS IN ARGUMENTS
  7. 17:27CAN WE ACCEPT BOTH REF & STATIC VALUES?
  8. 18:50FORGIVING API VS. STRICT API
  9. 19:17LIFECYCLE HOOKS VS. WATCH
  10. 20:47WATCHO TO THE RESCUE
  11. 23:00RETURN COMPUTED RETURN REF
~/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.