Skip to content

Documentation doesn't explain record states #41

@seanrucker

Description

@seanrucker

I can see that records have these four properties:

  • isPending
  • isRejected
  • isRequested
  • isResolved

I gather that when isResolved = true the record.content property is fulfilled and I can render my template. I'm guessing that isRejected is true if the load failed. What is the difference between isPending and isRequested?

Probably all four should be explained in the documentation with some sort of sample template logic. Example:

{{#if record.isResolved}}
    {{#with record.content as |model|}}
        <div>{{model.name}}</div>
    {{/with}}
{{else if record.isRejected}}
    <div class="error">Error</div>
{{else}}
    <div class="loading">Loading...</div>
{{/if}}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions