bitovi/canjs — pull request #1031 by retro (2014-05-30 21:53:32+00:00)
Title: Mustache deferreds

Implements `def` helper that can handle deferreds in the template code.

Sample use:

{{#def Todo.findAll}}
{{#if isResolved}}
{{@data}}
... iterate over the data
{{/}}
{{/if}}

{{#if isRejected}}
{{@error}}
... print out the error
{{/}}
{{/if}}

{{#if isPending}}
still pending
{{/if}}
{{/def}}

I prefer this syntax to anything other mentioned in the #179 because it's more explicit and it's immediately clear what's happening.

`def` helper can also handle non-deferred values in which case it will treat it as resolved.

@justinbmeyer any comments?