usepropeller/react.backbone — pull request #13 by markijbema (2014-03-12 15:10:07+00:00)
Title: Fix force update after unmount

In this pull request I did several things.

I unified the behaviour for collections and models. both debounce their events now, and both support onModelChange.

Secondly, I unified some constructs. So guard statements are now all guard statements, instead of sometimes surrounding ifs for instance.

I extracted _subscribe and _unsubscribe. This means that if you add another mixin which defines _subscribe, or define _subscribe yourself, it will still work. This also means, it would conceptually be possible to mixin BackboneMixin multiple times.

I made the model mixin more similar to the other stuff mixed in. I extracted the 'view' methods, which make a component more like a backbone view, to a mixin. Now createbackboneClass only adds two mixins.

Other than that it's mostly small fixes.

I'm interested in discussing the choices in this. We need a class/mixin which provides binding for backbone models for react components. I personally think the 'view'-methods (getModel, model, el) aren't a good idea, and are mainly useful for conversion from Backbone Views to React Components. But when you are converted, they're only confusing, as they add non-standard stuff to react, while saving very little.

I'm not sure where you want to take the library, so I'm not sure if you like all the changes. If you disagree with me on the latter point, it might be better for me to start my own library, but I'd rather not (and I don't think at this point it's needed, as I just can use the mixin, and avoid using createBackboneClass).