Trying to troubleshoot this code,
import { Event, Router, RoutesRecognized, ActivationStart, NavigationEnd } from "@angular/router";
...
this._router.events.pipe(
filter((evt: Event) => evt instanceof RoutesRecognized),
map((evt: RoutesRecognized) => evt.state.root),
).subscribe((rootRoute: ActivatedRouteSnapshot) => (
this._resolvedRoutes = this._getResolvedRoutes(rootRoute.children)
));
Which is producing this error,
ERROR: projects/acme/angular-ui/src/lib/services/breadcrumb/breadcrumb.service.ts:213:11 - error TS2345: Argument of type 'MonoTypeOperatorFunction<Event>' is not assignable to parameter of type 'OperatorFunction<Event, Event>'.
Types of parameters 'source' and 'source' are incompatible.
What exactly is the problem here? I'm guessing the MonoTypeOperatorFunction<Event> function is the filter, but I have no idea what the OperatorFunction<Event, Event> why would there be two type-variables in the map? How do I resolve this?