-
Notifications
You must be signed in to change notification settings - Fork 355
Help #652
Comments
Hi, we have quite a lot of posts on this project on the Artsy blog: http://artsy.github.io/blog/categories/eidolon/ |
I have read some articles, but still can't understand about the detail implementation. Just hope that you can add some notes about Auction List this project in your free time |
Hi there, what details are you having a hard time with? By "auction list" do you mean the list of artworks for sale in an auction? It has mostly to do with UICollectionView and isn't the best implementation. If I were writing this from scratch it would use RxDataSources. I'll try to answer any specifics, but my "free time" is quite limited 😉 |
https://github.com/artsy/eidolon/blob/master/Kiosk/Auction%20Listings/ListingsViewModel.swift#L93 this is the most hard to deal with, how is it work? It seem that
these funcs all have some relationships,how they work together? 🙏 |
Hmm, yeah those should definitely be better documented 😅 I'll give you a brief description here: recurringListingsRequestThis is the top-level function that returns an observable that gets all the new listings every 60 seconds. It then checks to see if the number of sale artworks has changed and if so replaces the array, otherwise updates them in-place. allListingsRequestThis does a few things: it handles scheduling JSON parsing in the background to avoid stalling the UI, bootstraps the initial call to retrieveAllListingsRequestA recursive call that fetches a page of sale artworks, and fetches that page + 1 if we got back the same number that we expected to. For example, if there are 41 artworks and we fetch 20 at a time, then we recurse twice: once after the first page, and once after the second. Then the third page returns only one sale artwork so we know we have exhausted the list. listingsRequestThe simplest one, it just makes the actual network request. Each one of these does a lot, and if I were writing code fresh I'd break them into their own objects. There's a lot to understand, so it's natural if it feels unfamiliar or intimidating. I'll try my best to answer an specific follow-up questions, but I'm travelling right now and don't have a tonne of availability. Also, if after studying the file you were to send a PR adding comments explaining everything for the next person, that would be swell. But no pressure! |
I think this issue is addressed, so I'm going to close it. Feel free to re-open if you have any follow-up 👍 |
hello, I'm a new comer to RxSwift and Moya. Now I'm reading,learning your code but a little hard to understand, can you write some article just about Auction List this project?
The text was updated successfully, but these errors were encountered: