Trying to handle an OAuth login scenario where if the user lands on a page with authorization_code
in the query string, we process the token and continue
I guess that's by design.
queryParams
is the BehaviorSubject
As you can see in the docs
One of the variants of Subjects is the BehaviorSubject, which has a notion of "the current value". It stores the latest value emitted to its consumers, and whenever a new Observer subscribes, it will immediately receive the "current value" from the BehaviorSubject.
As workaround you can use debounceTime
operator as follows:
import 'rxjs/add/operator/debounceTime';
this._route.queryParams
.debounceTime(200)
.subscribe(params => {
console.log(params);
});