meteor/meteor — pull request #273 by tmeasday (2012-08-13 05:57:18+00:00)
Title: Add a complete() method to the subscription handle.

A reactive function that can be used as an alternative to the onComplete callback. This allows us to do:

```handlebars
{{#if postsLoading}}
Loading...
{{else}}
{{#each posts}..{{/each}}
{{/if}}
```

```js
var posts = Meteor.collection('posts');
var postsHandle = Meteor.subscribe('posts');

Template.foo.postsLoading = function() {
return !postsHandle.complete();
}

Template.foo.posts = function() {
return posts.find();
}
```

(Note that this change would be significantly simpler if deps had a slightly larger toolkit, like #193)