Having issues getting my subscription to subscribe to the published collection. It seems to be stuck at subscription.ready()
but never goes from false to true.
Here is my api/dealer.js that creates my collection
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
import { check } from 'meteor/check';
const Dealers = new Mongo.Collection('Dealers');
export default Dealers;
Here is my server/publication.js that publishes that collection
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import Dealers from '../dealers';
Meteor.publish('dealers.list', () => Dealers.find());
Here is my component that doesnt do anything right now.
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { Link } from 'react-router';
import { Grid, Row, Col, Clearfix, Form, FormGroup, FormControl, ControlLabel, Button, Checkbox } from 'react-bootstrap';
class DealerList extends Component {
render() {
return(
<h1>Hi</h1>
)
}
}
export default DealerList;
And lastly here is my react-komposer container that takes the data from the publication and makes it reactive in the component. I dont think I am missing anything but it is just stuck at loading.
import { composeWithTracker } from 'react-komposer';
import { Meteor } from 'meteor/meteor';
import Dealers from '../../../api/dealers/dealers';
import DealerList from '../../components/Dealers/DealerList';
import Loading from '../../components/Loading.js';
const composer = (props, onData) => {
const subscription = Meteor.subscribe('dealers.list');
const dealers = Dealers.find().fetch();
if (subscription.ready()) {
const dealers = Dealers.find().fetch();
onData(null, { dealers });
}
};
export default composeWithTracker (composer, Loading)(DealerList);
Any help would be really appreciated. I think i have everything set up and i’ve been reading through the docs but I am really stuck.