我有这样一个示例 Meteor 应用程序:
import React from 'react';
import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import { Mongo } from 'meteor/mongo';
Things = new Mongo.Collection('things');
if (Meteor.isClient) {
Meteor.startup(() => {
Tracker.autorun(() => {
console.log('AUTORUN');
});
Meteor.subscribe('things');
render(<div>Hello world</div>, document.getElementById('app'));
});
} else if (Meteor.isServer) {
Meteor.publish('things', function() {
return Things.find({});
});
}
我希望在修改我的Things
集合中的一个文档时应该触发自动运行功能,但事实并非如此。所以我的问题是:修改订阅数据后应该满足什么条件才能触发自动运行功能?