Refactor PostsDataProvider
MarcoSero opened this issue · comments
Marco Sero commented
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 BOOL
s.
ComponentKit provides some facilities to fix this. See facebook/componentkit#307