Settings

Theme

HumbleUI: Managing State with VDOM

tonsky.me

4 points by j13n 2 years ago · 1 comment

Reader

classicalcomplx 2 years ago

Very thoughtful post I feel that properly looks at local state and how to make it viable from a scalability standpoint. However, anyone else on train of local state = just bad?

The common argument against global state all the state is that some local state bookkeeping becomes too cumbersome, just like the article mentions hence the need for things like hooks. But, in practice I found paying the cost of build a global state render pipeline pays well in the long-term.

Typically, you only need to set it up once (and Clojure's data-oriented core makes that cost enjoyable even), and once you do get gain huge leverage for those cross-cutting UI/UX concerns (hide all modals when a fatal error occurs, check all form elements for validity before optimistically saving values, close all sidebars to make room for a payment modal, etc.)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection