These are chat archives for jdubray/sam

Apr 2018
Jean-Jacques Dubray
Apr 25 2018 01:28
This is a very impressive code sample, a functional implementation of a TODO app by Iven Marquardt
@jannesiera Being truly honest, I don't believe so. There is just a bit of boiler plate in the proposal/acceptor connection, but the benefits greatly outweight the slight inneficiencies. What do you prefer? Writing some boilerplate free code (though I am not sure what that will look like) that becomes quickly hard to maintain or hand-off, or write a bit of boilerplate and keep the complexity of your code constant?
Fred Daoud
Apr 25 2018 10:39
very interesting, thanks @jdubray ! I will have to read that carefully with my :coffee:
Fred Daoud
Apr 25 2018 11:33
there definitely are some interesting functional programming concepts there..
certainly only vanillajs for DOM manipulation.. very #UseThePlatform
Hamza Ouaghad
Apr 25 2018 23:40
@jdubray Oh I agree, the more I learn about the pattern the better it gets.
So there is this other thing I wanted to mention, since in the SAM loop (althought just visually) there is a database icon, and that kind of confuses people I suppose, to the point they all think of the model as some ORM model representing some database collection/table whatever...
So my idea for purely frontend projects that are totally decoupled from a backend, basically a microservice holding a frontend client
Is that
The model is the sam model could represent frontend states, data related to components, data aggregations from the backend resulting in presentable frontend views (removing all the backend clutter) and the state would simply be a pure function mapping those models into each view's, so V = State(Model(action(event))), where the state function from a mathematical perspective is almost a functor, but grows into an application
So the models of the frontend represent the data aspect the frontend needs where the state is usually the computation of the concerned models to the particular views
Ofcourse, actions would propose mutations to the model and the model would talk to an API when it accepts the change or so
What are your thoughts on that?