~/talk

5 Patterns for Better Components

slides:none on file

Five concrete patterns for cleaner Vue components with code-level fixes: implement a global State singleton using the Composition API (reactive outside the composable, expose pieces with toRefs + readonly and methods), split mutually exclusive branches into separate components via the hidden components and extract-conditional patterns, prefer passing whole objects (Preserve object) and split types for hidden state, and encapsulate v-for loops into list components. Examples use Pinia as a comparison and the Clean Components Toolkit documents 18 patterns in Clean Components Toolkit with refactor walkthroughs and quizzes.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08State management problems
  3. 6:12Hidden components extraction
  4. 9:28Preserving objects
  5. 13:20Conditionals extraction
  6. 16:11Lists simplification
  7. 17:35Vue learning resources
  8. 21:19Answering audience questions
~/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.