Last active
April 24, 2016 16:10
-
-
Save czbaker/0c45febf85df216aefff56f6ed9fa132 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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