by asolove · 12y ago · 0 comments
Edit: Ok, I now see how the Om todo example is handling update, and it's really cool. It creates a set of channels that encapsulate the knowledge of how to handle each type of change to a todo [0]. That gets passed in to the todo widget as "chans" and the widget sends messages to it in its event handlers [1]. I wonder if this whole channel CRUD abstraction is general enough to make it part of Om or another layer so that it didn't have to be recreated each time.
[0] https://github.com/swannodette/todomvc/blob/gh-pages/labs/ar...
[1] https://github.com/swannodette/todomvc/blob/om/labs/architec...
this is precisely how React works.