These are chat archives for jdubray/sam

19th
Mar 2016
Jean-Jacques Dubray
@jdubray
Mar 19 2016 14:05
It's really interesting to see Andre's insights on React and Reactive architecture in general
Jean-Jacques Dubray
@jdubray
Mar 19 2016 14:10
In particular this reference to Dan's tweet: "How to introduce declarative effects without alienating most developers is a tricky question."
https://twitter.com/dan_abramov/status/689641234986573825
Jean-Jacques Dubray
@jdubray
Mar 19 2016 14:17
I'd like to reiterate that from a SAM's perspective the State function, S(), is responsible for assembling the components of the view in the current state. S() is aware of all the allowed actions in the current state such that components can be, just components, totally unaware of the underlying application.
You can see that in the TODO(SAM) example:
theme.filters = (displayActive,displayCompleted,count,completedCount,intents) => {
       ...
      <a '+displaySelectedClass+'href="#/" onclick="JavaScript:return actions.'+intents['displayAll']+'({});">All</a>
     ... 
}
The component simply expect that the S() function will provide a mapping between its intent(s) and the action that needs to be wired.
Jean-Jacques Dubray
@jdubray
Mar 19 2016 14:23
The problem I see in any framework thus far is that everyone is trying to solve that problem with an approach that's suboptimal. You simply cannot avoid the decoupling between M-S-V.
Jean-Jacques Dubray
@jdubray
Mar 19 2016 18:06
Interesting to see the kind of problems Dan is focusing his attention on: reactjs/redux#1528
First, if he would decouple the actions from the model, actions would be far more composable and the model far more decomposable.
Second, if he would introduce a State function to compose the view from the Model (and nap() too), the view itself would be inherently insensitive to the structure of the before mentioned model.
But what do I know?
weepy
@weepy
Mar 19 2016 20:12
Why not suggest it!
Jean-Jacques Dubray
@jdubray
Mar 19 2016 20:38
I did! somebody had actually suggested something very close (@acjay)
This made my day: ARE YOU A CARGO CULT CODER?
During World War II American forces built airbases on islands in the Pacific that they used to deliver cargo—rations, clothes, etc.—to the army. Once the Americans left, anthropologists discovered cults on the islands that they had not previously noticed. The islanders used coconut palms and thatch to build exact copies of the runways, plants, and radio towers. “Dispatchers” sat in towers holding coconut halves (headphones) to their ears and shouting into bamboo microphones, while “ground crews” below them waved “signal flags.” The natives had seen cargo-laden planes flying in once the American soldiers had done the same, and assumed the actions they were pantomiming were all it took to bring the planes and their food back again.
Jean-Jacques Dubray
@jdubray
Mar 19 2016 22:15
Anybody has tried LightTable? http://docs.lighttable.com/tutorials/full/