Problem:
I have to display large amount of data
Use pagination that can change count (user can select display 10 / 20 /50 per page)
Was trying using rxjs following link https://blog.thoughtram.io/angular/2018/03/05/advanced-caching-with-rxjs.html
But I have 2 issues using this....
4.1. This gives the latest data but I need to display data for that particular page and also display the same when I come back again
4.2. I use a search on top which requires me to use the whole data but since this caching gets data in steps I will have issue when user searches before the complete data is pulled from the backend service...
Please suggest the best way to accommodate this issue....
RXJS subjects have 3 different types of feeds, as far as
it sounds like you're looking for #3 correct? If so, just look into ReplaySubjects.
Subject - a subscriber will only get published values that were emitted after the subscription. A
BehaviorSubject - the last value is cached. An subscriber will get the latest value upon initial subscription.
ReplaySubject - it can cache up to a specified number of emissions. Any subscribers will get all the cached values upon subscription.