modelhook in which we are fetching our posts. (fetching definition is simplified)
@modelargument which contains the result form
model()hook, and iterate through every post to display its
model()hook is resolved
postsdata we will "refresh" the whole page
model()like equivalent. For this case we chose component to learn how to encapsulate and isolate our app.
fetchPostswhich looks almost identically to previous
model()hook. In this case it is a function, however it can be a getter or just a property.
fetchPostsrecieves an AbortController which allows you (or the request maker) to watch when Ember Await has aborted the request. As we are using
fetchwe are passing the
signalto it, so it can abort the request when needed. This will optimize your data fetching and ensure there is always one pending request at the time.
<Await />component which provides us state components for pending, fulfilled and rejected state. Thanks to them we can be sure that their content will be rendered only when promise reach proper state.