MarcoSero / HackerNews

An open source, beautifully designed Hacker News client for iPhone

Home Page:http://marcosero.com/blog/i-made-a-hacker-news-app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor PostsDataProvider

MarcoSero opened this issue · comments

PostsDataProvider.mm got too big and it has a lot of "RAC-Spaghetti" code and internal state.

Also, since ComponentKit does its layout asynchronously, after adding the new posts to the data source they are not rendered on screen, that means that isReachingBottomSignal will still emit YES.
We want to avoid fetching the content multiple times but at the same time we want to dismiss the loading indicator immediately, so that's why some additional internal state is kept as a BOOLs.

ComponentKit provides some facilities to fix this. See facebook/componentkit#307