We just created a service called MovieService that synchronously calls the getMovies() method to retrieve the collection of movies. As we are consuming an external source, such as a web API, to retrieve the collection of movies, our application has to wait until the server responds with the list of movies, as the getMovies function is synchronous.
So we need to implement an asynchronous mechanism to retrieve the collection of movies. In such way, we can avoid making our application wait until the web API responds with the collection of movies. We can achieve this by using promises.