【发布时间】:2018-03-27 01:28:37
【问题描述】:
我有以下两种发布方法,但是当我在客户端搜索页面中订阅其中一种发布方法时,它被另一种用于索引页面的方法覆盖。
服务器
Meteor.publish("task.index", function() {
TaskCollection.find()
}
Meteor.publish("task.index.search", function(state) {
TaskCollection.find({ state: state })
}
客户端 - 搜索页面
Meteor.subscribe("task.index.search", state)
// this will always be overwritten with "task.index" published collection
客户端 - 索引页面
Meteor.subscribe("task.index")
有谁知道如何避免这种情况?
【问题讨论】:
标签: meteor meteor-publications