arunoda / react-komposer

Feed data into React components by composing containers.
MIT License
732 stars 70 forks source link

How many subscriptions is too many for this? #147

Open jr69 opened 7 years ago

jr69 commented 7 years ago

Does react-komposer reuse subscriptions, i.e. doing something like:

Meteor.subscribe('test'); Meteor.subscribe('test'); Meteor.subscribe('test'); Meteor.subscribe('test'); Meteor.subscribe('test'); Meteor.subscribe('test');

So can I have many small React components with containers? Or should I have one big container, and then have many small react components inside it, with less overhead

janzenz commented 7 years ago

I have somewhat similar question. Mine is about nested components, does it cause performance issue if we repeatedly connect each nested component, let's say with similar data or any data that can be derived from the ParentContainer? In Redux this is acceptable and encouraged I don't know with Komposer.

For example

function dataLoader() {
  Meteor.subscribe('test');
}

compose(dataLoader())(ParentContainer)

function dataLoader() {
  Meteor.subscribe('test');
}

compose(dataLoader())(GreatGrandChildContainer)