These are chat archives for jdubray/sam

19th
Jan 2018
devin ivy
@devinivy
Jan 19 2018 01:17

thought yall might enjoy this example i ran into :)

https://github.com/PolymerLabs/polymer-redux-hn

Jean-Jacques Dubray
@jdubray
Jan 19 2018 02:22
It's rather SAMish at first sight.
Marcus Feitoza
@mfeitoza
Jan 19 2018 14:37
@jdubray how are you dealing with async/fetch/promise inside model.present before close reactive flow?
Jean-Jacques Dubray
@jdubray
Jan 19 2018 15:04
@mfeitoza You can do the same thing as actions which trigger the present method upon returning from the API call, you only trigger state.render when the API call returns. Of course you have to make sure that the model remains synchronized, but conceptually that's OK IMHO. While waiting, action proposals can be queued and then dequeued via NAP.
The main advantage of defining a clear "step" is that you take all these decisions in confidence. Immutability and pure functions do not enforce what a step is from an API call perspective. It doesn't mean that all API calls have to be blocking, they are not, if you choose too, but they belong to a step, you can't arbitrarily throw actions in between the call and the response and expect good results.
Marcus Feitoza
@mfeitoza
Jan 19 2018 15:37
Thank you!