0

Is there a rerender event or event fired when when minimongo db changes in Meteor.js?

I am making a messenger with meteor js and i need to scroll down when i get a new message and thisbshould be done when new message(html) is inserted by meteor.

  • This is a problematic UX pattern on its own (I would prefer a small notification that invites me to click to see new messages). If you insist on scrolling on new messages, then perhaps keeping a scroll position as a state variable and updating it upon a new message will be a better option. – MasterAM Nov 17 '15 at 14:40

2 Answers2

0

You can declare anything in the template onRendered function http://docs.meteor.com/#/full/template_onRendered

If your messages are single templates, then it will be fired on every render.

Guidouil
  • 1,694
  • 2
  • 18
  • 18
0

I don't know any details about your implementation, since you haven't supplied any code examples, so I can only suggest that maybe meteor-collection-hooks is what you are looking for. The guide says that they can be used on the client, server and both.

If by minimongo db you mean that you are using a client side only collection, then you should be aware that it won't persist on page reloads.

MarkTomm
  • 56
  • 3