当用户添加到集合时,Meteor不会重新渲染

时间:2017-08-01 07:39:57

标签: javascript reactjs meteor reactive

当一个新用户添加到users集合时,html不会重新渲染,尽管我可以在websocket中看到它。

JSFiddle

publication.js:

export default createContainer(({ code }) => {
  const imagesHandle = Meteor.subscribe('images.all');
  const usersHandle = Meteor.subscribe('users.name.by-game', code);
  const gameHandle = Meteor.subscribe('games.get-by-code', code);
  const loading = !imagesHandle.ready() || !gameHandle.ready() || 
                  !usersHandle.ready();
  const game = Game.findOne();
  return { loading, game };
}, GameRouterContainer);

订阅行:

{{1}}

1 个答案:

答案 0 :(得分:0)

发布功能中不需要this.autorun(function() {

此外,如果问题与渲染有关,那么您粘贴的代码将无法让我们为您提供帮助。