What's the difference between rendered and onRendered?

What is the difference between Template.myTemplate.rendered and Template.myTemplate.onRendered ?

Template.foo.rendered has been deprecated and replaced with Template.foo.onRendered. onRendered is a function that takes a callback as an argument, while rendered was a property that you set to a function. onRendered is more versatile as you can call it multiple times to attach more than one callback.

/* Deprecated */
Template.foo.rendered = function () {}

/* Replaced with */
Template.foo.onRendered(function () {
  // ...

And you have onCreated and onDestroyed now as well

Thank you both for your prompt reply :slight_smile: