PkRSS icon indicating copy to clipboard operation
PkRSS copied to clipboard

If load(url) is called on the same url the articles will be added again

Open dgogoasa opened this issue 8 years ago • 2 comments

Is this how it is supposed to work? I am trying to refresh the articles from a site every so often. But when I load them they are added to the list of existing articles... and they are the same. So I end up with 10 articles at the first load, then 20 , 30 , 40... Is there a way to remove the existing articles and load again from the same site?

dgogoasa avatar Jun 03 '17 03:06 dgogoasa

PkRSS.with(this).load(url).skipCache.async();

GerhardPue avatar Jun 28 '17 11:06 GerhardPue

@dgogoasa By default, new RSS items are appended to the internal memory storage. This is probably unpredictable behavior but it seemed to fit everyone's needs at the time of development. Perhaps this can be branched out into a separate module...

To answer your question, you can use a callback when loading your articles. The callback only returns iterms that have just been loaded. That way, you can manually manage newly loaded items to prevent duplicates.

Pkmmte avatar Jun 28 '17 17:06 Pkmmte