Subscribe deprecated use an observer argument

Warning:

Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8

The solution is that instead of using the following signature:

      .subscribe(
        (data) => {
          // success
        },
        (err) => {
         // error
        }
      );

you need to use the following now:

      .subscribe({
        next: (data) => {
          // success
        },
        error:(err) => {
         // error
        }
      });