Blame view

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