These are chat archives for jdubray/sam

24th
Sep 2017
Jean-Jacques Dubray
@jdubray
Sep 24 2017 04:31 UTC
I don't use it all the time (though it's logically better). It's useful to manage complex scenarios where you need to cancel API calls, handle server side events concurrently with user events,...
@robsiera at the time I didn't know how to synchronize the model in a simple way. Recently I learned about the "Bakery Algorithm" that Dr. Lamport created in the 70s. That would be part of my next iteration on SAFE.
https://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm
SAFE is also important for non-browser based apps.
Last but not least, SAFE implements time-travel.
Jean-Jacques Dubray
@jdubray
Sep 24 2017 04:36 UTC
I wish I could do this full time, but I have been very ill this year and I had to focus on keeping an income. It looks like the worst is behind now and hopefully 2018 should be a better year.
Michael Terry
@formido
Sep 24 2017 06:05 UTC
Wow, that's a shame, sounds awful
I hope you're feeling better
Jean-Jacques Dubray
@jdubray
Sep 24 2017 07:04 UTC
Yes thank you, the last 4-5 weeks have been nearly normal. On the positive side, it makes you aware on a number of things your take for granted like eating out, walking to the park or talking to a loved one. It also makes you painfully aware of how the health care system works. I saw a total of 7 doctors and "specialists" who simply didn't want to investigate or even try anything, even though my condition was degrading weekly, not to mention the health insurance questioning everything I would try on my own. It is... Dr. YouTube who found the treatment that got me to where I am today by crossing a couple of searches I had typed in. YouTube suggested watching a video that lead me to a physician (about 5 hours away from home), who got me back on my feet like he did for 100% of the patients with the same condition. Clearly health software is high on my list of priorities moving forward. I can't be mad at doctors, they are professional, their job is to not to use a patient as a research subject, their job is to make a diagnostic and apply the correct treatment, but it seems to me that they need much better tools to assist them. Imagine writing code, without any tool other than notepad? I think that's pretty much where they are today.
YouTube is vastly superior to any search engines today because it's trying to make suggestions based on the video you watched. That's very powerful in a field like medicine. It can quickly narrow what people find valuable/interesting.
Rob Siera
@robsiera
Sep 24 2017 09:18 UTC
Thank you JJ to open up a little bit on your health situation. It allows us into the role of observer, meaning we can apply the quantum observer effect (a.k.a. sending good vibes). I'm sorry to hear it took you so long to find the right treatment, but luckily you seem to be on the right track at the moment (sigh of relief).
Thx also for the link to the bakery algo. I'll keep that in mind.
Victor Noël
@victornoel
Sep 24 2017 10:16 UTC
Anybody tried to see how to architecture a angular/ngrx app to properly follow the SAM pattern? Something like SAM actions are ngrx effects, SAM state is selectors on the store, SAM model is the store, SAM events are one given set of ngrx actions only trigerring effects, SAM proposals are another given set of ngrx actions only triggerring the reducers... something like that :)
I think you could even introduce some kind of meta reducer / meta effects to ensure you don't mix the two sets of ngrx actions...
Jean-Jacques Dubray
@jdubray
Sep 24 2017 10:49 UTC
I have a headache already :-)
@robsiera thank you!
Victor Noël
@victornoel
Sep 24 2017 10:55 UTC
:P
Janne Siera
@jannesiera
Sep 24 2017 11:44 UTC
@jdubray glad to hear you are feeling better. Seems like you went through some kind of personal hell there.
@victornoel I have no idea, but wouldn't that be the basis of a petty strong dependency on ngrx? How would you transition if, for some reason, you need to switch from Angular to React in a year?
Jean-Jacques Dubray
@jdubray
Sep 24 2017 11:57 UTC
@jannesiera it's all right I am sure a lot more people go through much harder, it's just weird to become nearly 100% disabled. It's a great lesson to learn, in a way (and I am sure it does that to everyone) you get to learn how important are things you take for granted when they are taken away one by one (speaking, eating, walking,...). There was a point where the only thing I could do is type on my keyboard. I have learned so much about nutrition, the way the body works, ... it's fascinating. Anyways, it looks like I am out of the woods for now.
Jean-Jacques Dubray
@jdubray
Sep 24 2017 12:04 UTC
@victornoel Redux and NgRx have never been far from SAM (or vice versa), as we have discussed before, I do think however that naming an action a data structure is no helping much, I am not sure where this came from. They also make it a bit confusing as to where the mutation occurs since the output of the reducer is the mutated model. I am also not sure where API calls ought to be wired in. Redux had Sagas and Thunks. It looks like NgRx doesn't have either, but they have effects.
Victor Noël
@victornoel
Sep 24 2017 12:43 UTC
@jannesiera that's not really my concern, I'm just wondering about angular and ngrx, but any other "event dispatcher that works well with rxjs and is used by a bitg community" would be as good :)
@jdubray I know that, nevertheless I feel it is worth the time to investigate this :) API calls go into effects, for sure (basically, an effect is just whatever your want executed in response to an event and producing new events)
Jean-Jacques Dubray
@jdubray
Sep 24 2017 13:11 UTC
I am concerned with this kind of semantics, I know you are mapping them to SAM, but I just want to point out it's not ideal to have open semantics like that.
Nivani
@Nivani
Sep 24 2017 16:01 UTC
@victornoel I have tried this by implementing my own "library" based on what I saw using ngrx but following SAM pattern and it turns out the only thing you need is like ~30 lines of code to manage the model and acceptors: https://github.com/Nivani/todo-sam/blob/master/src/sam/initializeSAM.ts and some interfaces because it's Typescript.
Victor Noël
@victornoel
Sep 24 2017 16:55 UTC
@Nivani yep, that could work too :)
Victor Noël
@victornoel
Sep 24 2017 17:02 UTC
@Nivani thx for the code!
Rob Siera
@robsiera
Sep 24 2017 20:20 UTC
this vue-vuex-rocket-launcher doesn't seem to have any reference to vuex. Am I missing something? Who created this example?