stack overflow logoI working on a new Angular 2 service today that wraps the HTTP class. The purpose of this service is to intercept errors, and log the user out when the HTTP status code of the error object is 401.
Everything seemed fine until I realized that each GET and POST was firing twice. After a lovely hair-pulling session, I realized that it was the 2nd observable subscription that was causing the double network calls. Messy stuff.

If you find yourself wresting with the same problem, this Stack Overflow answer nails it. Cheers to dfsq for his great answer: