{"action":"created","issue":{"url":"https://api.github.com/repos/AdamBrodzinski/meteor-flux-leaderboard/issues/15","labels_url":"https://api.github.com/repos/AdamBrodzinski/meteor-flux-leaderboard/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/AdamBrodzinski/meteor-flux-leaderboard/issues/15/comments","events_url":"https://api.github.com/repos/AdamBrodzinski/meteor-flux-leaderboard/issues/15/events","html_url":"https://github.com/AdamBrodzinski/meteor-flux-leaderboard/issues/15","id":123996977,"number":15,"title":"Determining whether a collection has loaded.","user":{"login":"TimFletcher","id":72888,"avatar_url":"https://avatars.githubusercontent.com/u/72888?v=3","gravatar_id":"","url":"https://api.github.com/users/TimFletcher","html_url":"https://github.com/TimFletcher","followers_url":"https://api.github.com/users/TimFletcher/followers","following_url":"https://api.github.com/users/TimFletcher/following{/other_user}","gists_url":"https://api.github.com/users/TimFletcher/gists{/gist_id}","starred_url":"https://api.github.com/users/TimFletcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimFletcher/subscriptions","organizations_url":"https://api.github.com/users/TimFletcher/orgs","repos_url":"https://api.github.com/users/TimFletcher/repos","events_url":"https://api.github.com/users/TimFletcher/events{/privacy}","received_events_url":"https://api.github.com/users/TimFletcher/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-27T21:25:15Z","updated_at":"2015-12-28T16:32:23Z","closed_at":"2015-12-28T16:32:23Z","body":"If I subscribe to data in a controller component thus:\r\n\r\n```javascript\r\ncomponentWillMount() {\r\n  this.sub = Meteor.subscribe('campaigns');\r\n},\r\n```\r\n\r\nAnd I've connected this all up with Redux such that the component's props receive the campaigns:\r\n\r\n```javascript\r\nconst filterState = function filterState(state) {\r\n  return {\r\n    campaigns: state.campaigns,\r\n  };\r\n};\r\n\r\nCampaignPage = connect(filterState)(CampaignPage);\r\n```\r\n\r\nThen it's possible to determine when the subscription is ready in `render()` with `this.sub.ready()` but at this time the data is in MiniMongo but **not** yet available via redux / `this.props.campaigns`. If I log the following within `render()`:\r\n\r\n```javascript\r\nconsole.log(this.sub.ready(), this.props.campaigns);\r\n```\r\n\r\nThen I'll get:\r\n\r\n```\r\nfalse undefined // sub not ready, data not available\r\ntrue undefined  // sub ready, data in minimongo but not available via props\r\ntrue Object {}  // sub ready, data available via redux / props\r\n```\r\n\r\nDo you know of any way to reliably determine when the data is loaded **and** available via redux props?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/AdamBrodzinski/meteor-flux-leaderboard/issues/comments/167599750","html_url":"https://github.com/AdamBrodzinski/meteor-flux-leaderboard/issues/15#issuecomment-167599750","issue_url":"https://api.github.com/repos/AdamBrodzinski/meteor-flux-leaderboard/issues/15","id":167599750,"user":{"login":"AdamBrodzinski","id":1445367,"avatar_url":"https://avatars.githubusercontent.com/u/1445367?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamBrodzinski","html_url":"https://github.com/AdamBrodzinski","followers_url":"https://api.github.com/users/AdamBrodzinski/followers","following_url":"https://api.github.com/users/AdamBrodzinski/following{/other_user}","gists_url":"https://api.github.com/users/AdamBrodzinski/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamBrodzinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamBrodzinski/subscriptions","organizations_url":"https://api.github.com/users/AdamBrodzinski/orgs","repos_url":"https://api.github.com/users/AdamBrodzinski/repos","events_url":"https://api.github.com/users/AdamBrodzinski/events{/privacy}","received_events_url":"https://api.github.com/users/AdamBrodzinski/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T16:32:23Z","updated_at":"2015-12-28T16:32:23Z","body":"No prob! :+1: \r\n\r\nAlso you can cleanup the merge code by using spreads too, babel uses a Object.assign as a polyfill anyway:\r\n\r\n```javascript\r\ncase 'CAMPAIGNS_COLLECTION_LOADING':\r\n  return {...state, campaignsLoading: true};\r\n```"}}