I'm attempting to publish a collection, but my console is showing that it returns an array.
server/publish.js
HeartCount = new Mongo.Collection('heartcount');
Meteor.publish("currentHeartCount", function() {
return HeartCount.find().fetch();
});
RelypheTopContainer.jsx
class RelypheTopContainer extends TrackerReact(React.Component) {
currentHeartCount() {
return HeartCount.find().fetch();
}
componentWillUnmount() {}
data() {
const params = this.props.params;
const id = params.id;
this.state = {
subscriptions: {
relyphe: RelypheSubs.subscribe('oneRelyphe', id),
heartCount: Meteor.subscribe('currentHeartCount', id)
}
};
}
RelypheTop.jsx
<div className='dates' onClick={handleClickDate}>
<div className="particle-box" />
<div id="output">0</div>
<span style={{whiteSpace: 'nowrap'}}>{
birthDate&&relypheDate?`${birthDate} - ${relypheDate}`:
birthDate?birthDate:
relypheDate?relypheDate:
''}</span>
</div>
I am aiming to display the current count in the #output div on all users screens.