我想知道我的发布和订阅的实现是否正确。即时通讯新的流星js请帮助我。如果您需要更多关于我的代码的信息,我愿意为您提供其他源代码。我阅读有关发布和订阅的文档,但我不明白关于它的文档。如何正确实现发布和订阅流星js
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');
}
把你的代码放在这里不在图像中。 – pegla
我将您的代码直接添加到帖子并省略了不必要的行。如果您将代码直接放入您的帖子中,您下次将获得较少的回复。 :) –