Chapter 24 - Timeline fetcher

Hi, in chapter 24, TimelineFetcher have an timeline observable which will fetch data repeatedly.

Screen Shot 2021-03-17 at 3.27.43 PM

I can’t figure out why adding the scan operator can prevent it to emit element repeatedly.

Can some one explain this? Thanks.

(I use mock local data by the way.)

Are you sure scan is causing the issue? What if you add a debug before and after scan - what’s the output then?

Yes, I did that.
If scan is added, timeline will emit only one element.
Screen Shot 2021-03-18 at 10.39.29 AM

If I comment out scan, timeline will emit element every 5 seconds as I expected:
Screen Shot 2021-03-18 at 10.40.44 AM

This topic was automatically closed after 166 days. New replies are no longer allowed.