These are chat archives for jdubray/sam

Aug 2017
Janne Siera
Aug 15 2017 17:24
Does anyone here have a good graps of the 'unidirectional data flow' pattern as proposed by React? I always see people pointing out its differences with regards to two-way data binding. However, I fail to see how it is any different from the 'regular' DOM event system (props/attributes down, events up)?
devin ivy
Aug 15 2017 17:27
@jannesiera in theory i think you could say they are equivalent. there are many ways to "wire" unidirectional data flow. of course two-way binding is different from props/attrs down and events up, since it's effectively "props/attrs up".
Zach Dahl
Aug 15 2017 20:29
React proposes you should be able to generate your markup from your data without regard for the existing DOM.
This means your DOM cannot maintain state - it is just a reflection of your state.
This is what I would consider the primary directive of unidirectional data flow.
as devin suggested, its not really that different in practice: you just don't let the DOM be your source of truth. (this would be the props/attrs up)
Janne Siera
Aug 15 2017 21:07
Okay, that's pretty much what I was thinking. Good to see the source of truth comment again. Still perplexes and frustrates me that they felt the need to invent a completely new vocabulary to describe concepts that are as old as the dom itself.