3 ms·
One question: What is the advantage of using Stores over the approach of using Backbone Models as stores and rerender on 'change' events? https://github.com/c
by nchuhoai 12y ago
One question:
What is the advantage of using Stores over the approach of using Backbone Models as stores and rerender on 'change' events?
https://github.com/clayallsopp/react.backbone https://github.com/clayallsopp/react.backbone
I'm just starting with React, but IMO referring to the models in the component and calling methods on them is like the equivalent of calling actions through the dispatcher?
- Retozi 12y ago1. Stores can contain more than one "model", they cover a certain "domain" 2. Stores contain immutable data. This allows for reference equality checking which will yield performance gains 3. Stores do not contain asynchronous code. From the view of stores, it doesn't matter if user manipulates the state directly or triggered a fetch from a server. Using Backbone models is a valid strategy in my opinion though...
- nchuhoai 12y agoNot to sound too defensive, but couldn't you do all these things with Backbone Models as well?