Skip to content

Comment on Simpler UI Reasoning with Unidirectional Dataflow and Immutable Dataparent

Comments

I'm not quite understanding how the component determines whether it should redraw itself in this example. The component gets redrawn when the render function is called (if the data it's passed is different and if the output of the render changes) and the render function gets called when a "swap" event is raised, which is raised when a component updates the app state, but it's not saying "please redraw me now". It's not aware it's getting redrawn, it just happens.

Unless I've mis defined what "letting the component determine it needs to redraw" means in this context.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.