import { createContainer } from 'meteor/react-meteor-data';
import HomePage from '../pages/HomePage';

export default HomePageContainer = createContainer(() => {
  Meteor.subscribe('homePage.counters');
  Meteor.subscribe('homePage.users.last');
  return {
    usersLast: Meteor.users.find({}, {sort: {createdAt: -1}, limit: 5}).fetch(),
    counts: {
      users: Counts.get('users'),
      messages: Counts.get('messages'),
    },
  };
}, HomePage);

import { createContainer } from 'meteor/react-meteor-data';
import HomePage from '../pages/HomePage';

export default HomePageContainer = createContainer(() => {
  Meteor.subscribe('homePage.counters');
  const usersLastReady = Meteor.subscribe('homePage.users.last').ready();
  return {
    usersLast: usersLastReady ? Meteor.users.find({}, {sort: {createdAt: -1}, limit: 5}).fetch() : [],
    counts: {
      users: Counts.get('users'),
      messages: Counts.get('messages'),
    },
  };
}, HomePage);

Check if subscription ready before pass documents
HomePage: Check if subscription ready before pass documents

When subscription not ready container may pass array of documents
(remaining from another subscription) that don't have all required
properties.
