Control Rx Subscriptions with Async Pipe and BehaviorSubjects

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

Each time you use the Async Pipe, you create a new subscription to the stream in the template. This can cause undesired behavior especially when network requests are involved. This lesson shows how to use a BehaviorSubject to observe the http stream so that only one request is made even though we still have two Async pipes in the template.

ganqqwerty
~ 7 years ago

Is there a material on how to organize my app when I have a lot of aspects of my state stored in the URL? For example, I have an search app, where I want my filters and search query to be in the URL, so that the user can easily share it.