RxJs pipe and lettable operator `map`: ‘this’ context of type ‘void’ is not assignable to method’s ‘this’ of type ‘Observable’

Lettable instance operators should be imported from rxjs/operators:

import { map } from 'rxjs/operators';

As opposed to non-lettable equivalents which are imported from rxjs/operator:

import { map } from 'rxjs/operator/map';

To learn more about lettable operator read:

  • RxJS: Understanding Lettable Operators

Leave a Comment

tech