Blame view

imports/ui/containers/EditDocument.js 538 Bytes
c42d4eeac   themeteorchef   handful of changes
1
2
3
4
  import { Meteor } from 'meteor/meteor';
  import { composeWithTracker } from 'react-komposer';
  import Documents from '../../api/documents/documents.js';
  import EditDocument from '../pages/EditDocument.js';
4c9b3dfc1   themeteorchef   cleaning up
5
  import Loading from '../components/Loading.js';
c42d4eeac   themeteorchef   handful of changes
6
7
  
  const composer = ({ params }, onData) => {
a10651520   themeteorchef   remove superfluou...
8
    const subscription = Meteor.subscribe('documents.view', params._id);
c42d4eeac   themeteorchef   handful of changes
9
10
11
12
13
14
15
16
  
    if (subscription.ready()) {
      const doc = Documents.findOne();
      onData(null, { doc });
    }
  };
  
  export default composeWithTracker(composer, Loading)(EditDocument);