Usage
Use <Await />
component to load your data in your components. You can take advantage of Yielded Components, like Pending
, Fulfilled
or Rejected
to define your UI based on promise state, example:
You can also control the state yourself using Yielded properties, where you can access isPending
, isRejected
etc...
Your @promise
can be anything. A promise, function which returns promise, a task (from ember-concurrency) or normal string. Sky is the limit.
You can also load the promise on demand using @defer
:
For more useful patterns in Ember Await check out the rest of the documentation and visit React Async for reference.
More Guides are coming soon!
Last updated