These are chat archives for jdubray/sam-examples

23rd
Feb 2016
Gunar C. Gessner
@gunar
Feb 23 2016 15:22
So, I am building a example using Redux-React-SAM. Redux is handling all Store mutations inside the Store (Model). I'd love to have your feedback https://github.com/gunar/sam-redux
bgusach
@bgusach
Feb 23 2016 15:50
Hello there, just have a small question that kind of prevents me from doing some toy applications and starting to grasp this SAM thing. When using functions to create the views (instead of templates or JSX, etc), how do define the event handlers? In the examples I have seen some stuff like return '<button onclick=somefunction(somedata)>', but I don't see that going a long way: what if I don't have a reference (even within a namespace) in the global scope? Thanks.
Gunar C. Gessner
@gunar
Feb 23 2016 16:15
@bgusach using functions that return html is an implementation that @jdubray likes but is not at all necessary for SAM. I myself find it hard to use after knowing about React/VirtualDom.
Jean-Jacques Dubray
@jdubray
Feb 23 2016 17:55
There is no requirement whatsoever to do so, or even use HTML at all. This is just a pattern that simply states that the view is created as a function of the model, in a similar way to React.js. The same thing could be achieved in Objective-C/Swift, Java (Android SDK), ...
bgusach
@bgusach
Feb 23 2016 20:16
I know, but for me it is about HTML and JS. And I really prefer good old javascript over a yet another framework (actually I found about SAM because of a comment on a blog post about the gazillion tools you need for JS development). And I think that it is easier to grasp the essence of something instead of getting distracted with yet-another-cool-thing (that cycle.js for instance)
Jean-Jacques Dubray
@jdubray
Feb 23 2016 20:29
a big THANK YOU!!