1.0.11 • Published 3 years ago

ember-async-component v1.0.11

Weekly downloads
61
License
MIT
Repository
github
Last release
3 years ago

ember-async-component

This ember addon is used for building promise aware container components which handles success, loading and error states. This component also works seemlessly with ember-cli-fastboot

Compatibility

  • Ember.js v3.16 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-async-component

Usage

This is the suspense component which be used to by container components when making API calls in a component. This component handles server side rendering issues and loading and error states out of the box for the consumer

@param {Function|object} promise Required promise for the component to render the loading, success and error state @param {boolean} blockRender Default is false. Used for deciding if the fastboot server should wait for the API call to complete

<Suspense
 @promise={{this.promise}}
 @blockRender={{false}}
 as |task|
>
 {{#if task.isLoading}}
   Loading...
 {{else if task.isSuccess}}
   {{task.data.userRequest.name}}: {{task.data.userRequest.time}}
 {{else if task.isError}}
   Error occurred: {{task.errorReason}}
 {{/if}}
</Suspense>

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago