Coder Social home page Coder Social logo

Help about eidolon HOT 6 CLOSED

asasdasasd avatar asasdasasd commented on August 26, 2024
Help

from eidolon.

Comments (6)

orta avatar orta commented on August 26, 2024

Hi, we have quite a lot of posts on this project on the Artsy blog: http://artsy.github.io/blog/categories/eidolon/

from eidolon.

asasdasasd avatar asasdasasd commented on August 26, 2024

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

from eidolon.

ashfurrow avatar ashfurrow commented on August 26, 2024

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 😉

from eidolon.

asasdasasd avatar asasdasasd commented on August 26, 2024

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

1. fileprivate func recurringListingsRequest() -> Observable<Array<SaleArtwork>> 
2. fileprivate func allListingsRequest() -> Observable<[SaleArtwork]>
3. fileprivate func retrieveAllListingsRequest(_ page: Int) -> Observable<Any> 
4. fileprivate func listingsRequest(forPage page: Int) -> Observable<Any>

these funcs all have some relationships,how they work together? 🙏

from eidolon.

ashfurrow avatar ashfurrow commented on August 26, 2024

Hmm, yeah those should definitely be better documented 😅 I'll give you a brief description here:

recurringListingsRequest

This 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.

allListingsRequest

This does a few things: it handles scheduling JSON parsing in the background to avoid stalling the UI, bootstraps the initial call to retrieveAllListingsRequest (which is recursive), and concatenates all the results of API calls together into one array.

retrieveAllListingsRequest

A 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.

listingsRequest

The 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!

from eidolon.

ashfurrow avatar ashfurrow commented on August 26, 2024

I think this issue is addressed, so I'm going to close it. Feel free to re-open if you have any follow-up 👍

from eidolon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.