I would like to know if my implementation of publish and subscribe are correct. Im new at meteor js please help me. If you need more information regarding to my code, i am willing to give you the other source code. I read the documentation about publish and subscribe but I didn't understand the documentation about it.
import { Mongo } from 'meteor/mongo';
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
export const Notes = new Mongo.Collection('notes');
if(Meteor.isServer) {
Meteor.publish('secureData', function() {
return Notes.find({});
});
}
if(Meteor.isClient) {
Meteor.subscribe('secureData');
}