模拟出版物的延迟

在现实世界中,可能会发生连接和服务器延迟,以模拟开发环境中的延迟,可以使用 Meteor._sleepForMs(ms);

Meteor.publish('USER_DATA', function() {
    Meteor._sleepForMs(3000); // Simulate 3 seconds delay
    return Meteor.users.find({});
});