Is there a way to attach two pipes to an HttpClient request in order to execute functions at the beginning and end of the request? I have discovered the "finalize" operator for executing a function when the request is finished, but I am looking for an equivalent for the start of the request. Here's what my code looks like:
this.http.get<MyModel>('api/model')
.pipe(
// TODO missing something for startup
finalize(() => console.log('on start'))
)
.subscribe(result => {
console.log(result);
});
How can I achieve this desired outcome? Are there any built-in operators in RxJS that could help with this, or will I need to create my own solution? Any alternative suggestions?