These are chat archives for jdubray/sam

4th
Jan 2017
Zach Dahl
@schtauffen
Jan 04 2017 01:03
@jdubray his separation of concerns video is fantastic
https://youtu.be/0ZNIQOO2sfA for interested :P
Marcus Feitoza
@mfeitoza
Jan 04 2017 12:09

Hello guys, I'm Marcus from Brazil.
Thanks @jdubray for the SAM pattern.
Now a I have one question:
I using Mithril and Mithril has three ways of render
m.render - render one time
m.mount - render and wait for events or m.request
m.route - render, wait for events, m.request or routing change

So in my understating of SAM, for example I never will user m.mount but always use m.render for creating the reactive looping from the view -> action -> model -> state -> view, is correct?

Fred Daoud
@foxdonut
Jan 04 2017 14:33
@mfeitoza correct
Marcus Feitoza
@mfeitoza
Jan 04 2017 14:37
Thank you.
Jean-Jacques Dubray
@jdubray
Jan 04 2017 15:07
I am not familiar enough with Mithril, how do you trigger actions then after render? in other words how events (including routing events) are propagated back to SAM's reactive loop.
Fred Daoud
@foxdonut
Jan 04 2017 15:19
@jdubray it would be the same as in your examples, except that state.representation would use m.render.
and instead of onclick in HTML it would be onclick in Mithril, similar to onClick in React -- but typically in plain JS instead of in JSX. Although Mithril does have a JSX equivalent for those so inclined.
Jean-Jacques Dubray
@jdubray
Jan 04 2017 15:49
I see, thank you.
Vincent Jo
@inrix-vincent-jo
Jan 04 2017 22:04
@devinivy awesome find..
devin ivy
@devinivy
Jan 04 2017 22:05
:D
Vincent Jo
@inrix-vincent-jo
Jan 04 2017 22:05
I wonder how Go is...
devin ivy
@devinivy
Jan 04 2017 22:05
i think jj will enjoy... maybe too much :P
(just kidding!)
i played with go. pretty fun!
Vincent Jo
@inrix-vincent-jo
Jan 04 2017 22:06
tutorials?
devin ivy
@devinivy
Jan 04 2017 22:06
yes! one moment
that golang tour is the best i came across
Vincent Jo
@inrix-vincent-jo
Jan 04 2017 22:06
ah! nice.. I've seen this once when I was going around their website
I will try it.. thx!