#Getting http observable response from function

1 messages · Page 1 of 1 (latest)

sleek osprey
#

Hi everyone, I need to get the data that "next" returns once I subscribed to the observable of http client in a function, and then return the data. I do this in a Service so I can use it in multiple components but I'm really struggling to figure out how to do it

thick warren
#

Maybe you do not need to subscribe in your service but rather expose the http response as Observable (possibly treated and transformed) that is shared via shareReplay or similar.

sleek osprey