-
Book Overview & Buying
-
Table Of Contents
Angular for Enterprise-Ready Web Applications - Second Edition
By :
As covered in Chapter 1, Introduction to Angular and Its Concepts, we should only subscribe to an observable stream to activate it. If we treat a subscribe function as an event handler, then we're implementing our code imperatively.
Seeing anything other than an empty .subscribe() call in your code base should be considered a sign of ditching reactive programming.
In reactive programming, when you subscribe to an event in a reactive stream, then you're shifting your coding paradigm from reactive programming to imperative programming. There are two places in our application where we subscribe, once in current-weather, and the other in the city-search component.
Let's start by fixing current-weather, so that we don't drop back into imperative programming.
Angular has been designed to be an asynchronous framework from the ground up. You can get the...