Blame view
imports/ui/containers/documents-list.js
683 Bytes
d1f05315d
|
1 2 3 |
import { composeWithTracker } from 'react-komposer'; import { Documents } from '../../api/documents/documents.js'; import { DocumentsList } from '../components/documents-list.js'; |
aae5ce922
|
4 |
import { Loading } from '../components/loading.js'; |
d1f05315d
|
5 |
|
f0c912bf1
|
6 7 8 9 |
const composer = (params, onReady) => { const subscription = Meteor.subscribe('documents'); if (subscription.ready()) { const documents = Documents.find().fetch(); |
aae5ce922
|
10 11 12 |
// setTimeout is used to visually buffer the loading spinner so it's not // jarring. Can just call onReady directly if you wish :) setTimeout(() => { onReady(null, { documents }); }, 500); |
d1f05315d
|
13 14 |
} }; |
aae5ce922
|
15 |
export default composeWithTracker(composer, Loading)(DocumentsList); |