Skip to content

Instantly share code, notes, and snippets.

@czbaker
Last active April 24, 2016 16:10
Show Gist options
  • Select an option

  • Save czbaker/0c45febf85df216aefff56f6ed9fa132 to your computer and use it in GitHub Desktop.

Select an option

Save czbaker/0c45febf85df216aefff56f6ed9fa132 to your computer and use it in GitHub Desktop.
import { Meteor } from 'meteor/meteor';
import { createContainer } from 'meteor/react-meteor-data';
import ConfigForm from './config-form.jsx';
import Config from '/collections/config';
export default createContainer(() => {
const configHandle = Meteor.subscribe('getConfig');
const configLoading = !configHandle.ready(); // Not ready?
const configEntry = Config.findOne({});
const configExists = !configLoading && !!configEntry;
return {
config: configExists ? configEntry : []
};
}, ConfigForm);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment