These are chat archives for jdubray/sam

Feb 2017
Slađan Ristić
Feb 08 2017 00:01
@jdubray thanks for the heads up. I around with this more and I realised that I would like the action to give a hint to the Sam container when it is a cancelling action. Maybe it is wrong, then I still need to look at your SAFE container in more detail.
But it is true, with the Sam pattern I could isolate and realize that there can easily be incidental complexity in seemingly simple use cases. :)
So in consequence I have been able to play with my example while still learning from it.
Jean-Jacques Dubray
Feb 08 2017 02:17
sure, the way SAFE works is pretty straighforward. The container keeps track of the current step number (1,2,3,...) each time an action is triggered it's instance is tagged with the current step number. When an action presents a proposal, the container prevents any other action with the same step number to present their proposal. Once the State functions has rendered, the step number is incremented for the next action.
Artyom Shalkhakov
Feb 08 2017 12:01
Hi all, seems like SAM could be used to address the issue with MVC this article talks about:
Jean-Jacques Dubray
Feb 08 2017 12:08
that being said, SAM is agnostic to the way you render the view, it offers an intermediary, the "state function" that computes the state representation from the model. Depending on your Web Framework (or lack thereof) the state representation can be expressed as properties (angular2), HTML (vanilla.js) or even a function which will be invoked at display time.