Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mustache deferreds #1031

Closed
wants to merge 1 commit into from
Closed

Mustache deferreds #1031

wants to merge 1 commit into from

Conversation

retro
Copy link
Contributor

@retro 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
Copy link
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 October 22, 2015 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants