I've spent the last few days learning about observables and have started to embrace them in my Angular application. I have a Web API app that I am producing a client for through NSwagClient in typescript. I have an API action that has this as its signature:
Task<ActionResult<List<Product>>> GetProducts(int skip, int take)
The API client I have in typescript is invoked like this:
_client.GetProductsAsync(0, 10).subscribe(next => {console.log(next)}, err => {}, () => {})
In my mind, when I ask for the next load of products, (so, skip 10, take 10, and then skip 20, take 10), I need to update the parameters of the initial _client.GetProductsAsync call. But seemingly, I can't do this without unsubscribing and re-subscribing to the observable with the new parameters. This seems to work against the concept of observables in my mind as streams of data, as the observable should be created once and then somehow "triggered" to get more results and pipe them to the Observer.
How can I subscribe once to the API client and accomplish this?