Blaze Updates

A quick rundown of some new features coming to Blaze.

Next Release

New template callbacks {
}); {
}); {

Template level subscriptions

New template instance methods
subscribe and subscriptionsReady {

A new template helper Template.subscriptionsReady

<template name="foo">
  {{#if Template.subscriptionsReady}}
    Good things in here

Coming soon

Template 'state' ReactiveDict


Here's the default Meteor application converted to make use of the new Template instance state ReactiveDict.

Template.hello.onCreated(function() {
  // counter starts at 0
  this.state.set('counter', 0);

  counter: function() {
    return Template.instance().state.get('counter');
  'click button': function(event, template) {
    // increment the counter when button is clicked
    template.state.set('counter', template.state.get('counter') + 1);

#each .. in ..

{{#each person in people}}
  <li>{{}} from {{people.groupName}}</li>

{{#each people}}

{{#let x=y.z f=w.s}}
  {{x}} {{f}} {{w}}

Example from Slava's pull request

Sashko's "Proposal for Blaze 2" hackpad

Worth checking out, there's currently a load of ideas and discussion going on surrounding potential future changes to Blaze.

Also see Upcoming features in Meteor Blaze.

If I've missed anything, please let me know in the comments below!