These are chat archives for jdubray/sam

Jul 2016
Vincent Jo
Jul 11 2016 16:26
Hi JJ, I hope you are doing well I started to implement a autocomplete functionality in my app, and I was thinking that I do the filtering functionality inside of the model. Would this be acceptable, or is that too much heavy lifting for the critical section? I saw your example of mvc todo app that does a lot of forEach loops so I thought it would be okay, but the filtering could be another kind of a deal so I figure I ask
Jean-Jacques Dubray
Jul 11 2016 22:01
in general filtering does not have a strong impact on the application state. Only the filter value need to be stored. The filtering can be done in the action if you filter the results of a query, in the model if you'd like, but in your case it maybe more logical to do it in the State function since it seems closer to a state representation. So I would say state function or view component. Model is a bit overkill, but ok.
Mike Nichols
Jul 11 2016 23:14
it sounds like it is 'wrong' to pass along the proposal that is making the change to the 'state'/'learner' but if it provides context on a control state change, why not render(model, currentProposal)?