Blame view
imports/ui/containers/DocumentsList.js
546 Bytes
d1f05315d
|
1 |
import { composeWithTracker } from 'react-komposer'; |
cac7cbc73
|
2 |
import { Meteor } from 'meteor/meteor'; |
c42d4eeac
|
3 4 5 |
import Documents from '../../api/documents/documents.js'; import DocumentsList from '../components/DocumentsList.js'; import Loading from '../components/Loading.js'; |
d1f05315d
|
6 |
|
cac7cbc73
|
7 |
const composer = (params, onData) => { |
c42d4eeac
|
8 |
const subscription = Meteor.subscribe('documents.list'); |
f0c912bf1
|
9 10 |
if (subscription.ready()) { const documents = Documents.find().fetch(); |
cac7cbc73
|
11 |
onData(null, { documents }); |
d1f05315d
|
12 13 |
} }; |
aae5ce922
|
14 |
export default composeWithTracker(composer, Loading)(DocumentsList); |