Mustache deferreds #1031

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@retro
Contributor

retro commented May 30, 2014

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?

@daffl daffl modified the milestones: 2.1.2, 2.2.0 Jun 6, 2014

@daffl daffl modified the milestones: 2.3.0, 2.2.0 Jan 10, 2015

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl May 11, 2015

Contributor

This has been implemented in 2.2, closing this PR.

Contributor

daffl commented May 11, 2015

This has been implemented in 2.2, closing this PR.

@daffl daffl closed this May 11, 2015

@daffl daffl deleted the mustache-deferreds branch Oct 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment