Yielded components
Ember Await provides several components you can use inside in <Await /> and can use the same component many times.
Initial
InitialRenders only while the deferred promise is still waiting to be run, or you have not provided any promise.
Arguments
persistbooleanShow until we have data, even while loading or when an error occurred. By default it hides as soon as the promise starts loading.
Examples
<Await defer={{this.deferFn}} as |await|>
<await.Initial>
<p>This text is only rendered while `run` has not yet been invoked on `defer`.</p>
</await.Initial>
</Await>Pending
PendingThis component renders only while the promise is pending (loading / unsettled).
Alias: <Await.Loading>
Arguments
initialbooleanShow only on initial load (whendataisundefined).
Examples
Fulfilled
FulfilledThis component renders only when the promise is fulfilled (resolved to a value, could be undefined).
Alias: <Await.Resolved>
Yielded properties
dataanyResult from resolved promise
Arguments
persistbooleanShow old data while loading new data. By default it hides as soon as a new promise starts.
Examples
Rejected
RejectedThis component renders only when the promise is rejected.
Yielded properties
errorErrorError from rejected promise
Arguments
persistbooleanShow old error while loading new data. By default it hides as soon as a new promise starts.
Examples
Settled
SettledThis component renders only when the promise is settled (resolved or rejected).
Arguments
persistbooleanShow old error or data while loading new data. By default it hides as soon as a new promise starts.
Examples
Last updated
Was this helpful?