In the class Some
, there is a method called run
that returns an Observable and contains a pipe
within itself. Another pipe
is used when executing the run
method.
import { of } from 'rxjs';
import { map, tap, delay } from 'rxjs/operators';
class Some {
run() {
return of('Some request').pipe(
tap((res) => {
console.log('First -> ', res);
})
);
}
}
new Some().run().pipe(
map(res => console.log(`Second -> ${res}`))
).subscribe();
The console output will be:
First -> Some request
Second -> Some request
Now my concern is: I need to perform some operations within the method after this pipe
-> new Some().run().pipe()
has finished. With reference to this example, I aim for the following console output:
first:
Second -> Some request
and then
First -> Some request