mantrajs / mantra-sample-blog-app

A sample blog app built with Mantra

Home Page: http://mantra-sample-blog-app.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Komposing Posts from one collection with comments from a different collection without overfetching

venturecommunism opened this issue · comments

I have this sample repo that uses an older version of Mantra with mixins for fetching Meteor Data: https://github.com/AdamBrodzinski/react-ive-meteor/blob/master/both/components/Feed/FeedContainer.jsx

I'm trying to port this to Meteor 1.3 and new Mantra and I've opted to go with two composer functions/ One of the arguments of second composer function's subscription is the postIds from the first composer function:

[edited this line to link to a specific commit]

https://github.com/venturecommunism/meteor-taskwarrior-react/blob/41b98734ea1dde21f86d2bb4508fae178dd2e04c/client/core/containers/FeedContainer.jsx#L47

I'm not sure if this depsMapper is the right way to map these but I'm getting no errors yet no React containers are loading https://github.com/venturecommunism/meteor-taskwarrior-react/blob/master/client/core/containers/FeedContainer.jsx#L56

The main point is to prevent overfetching of subscriptions in additional composer functions and to prepare the way to use this 3rd party data sources.

Is this the right track? What's the next step?

If the answer is to pass the postIds down via props, is there an example of how to do that?

I think I'm mostly past this issue. Starting to see how a combination of Actions and passing down props will probably work so closing this issue.