3 ms·
It seems you could just pass the stores into the components as data - that's really what they represent. I'm not clear why this approach is eschewing that basic
by mmerickel 12y ago
It seems you could just pass the stores into the components as data - that's really what they represent. I'm not clear why this approach is eschewing that basic principle in favor of singletons.
- modarts 12y agoSame here: i'm not seeing the value of the additional indirection.
- jingc 12y agoThe stores contain the data, but they also include the logic for updating that data. For example, a store of all the comments would also subscribe to events for new comments and add them into the comment thread at the correct location. We've found it more maintainable to keep the application logic for a set of data and the data itself in one place rather than having a model that external pieces can modify.