clayallsopp / react.backbone

Plugin for React to make Backbone migration easier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collection "change" event default

tsjoberg opened this issue · comments

Hi just to confirm an assumption:

You didn't add "change" for the default changeOptions because your assuming the React Item/"Model" component would react to its own model changes and don't need to trigger the change from the parent collection?

Only add, remove, reset, sort since they would modify the count of item views (add, remove, reset) or change the order (sort) of the item views as they would be displayed?

Thanks!

I don't know if that's why @clayallsopp didn't add it, but I sure like it because of that. If you add change it will cause a lot of spurious updates. I did however add change myself for components which are selfcontained (and have no component per model). But having it do so by default is a bit surprising (even though this slightly breaks the react philosophy).

Tbh I think backbone/react isn't a good match. It's an okay one, but there are some points where they won't match very well. (like this one).

Out of curiosity @markijbema, what is a better match?

From what I read Flux, but I never got to switching. The modularity of backbone models doesn't map well to the rerender everything in React imho. Actually, I think if you just remove backbone, and use plain ajax, it would work fine as well.