gnosis / ido-ux

Interface for the ido-platform
GNU General Public License v3.0
25 stars 22 forks source link

[Refactor] consumption of api data #215

Open josojo opened 3 years ago

josojo commented 3 years ago

The data of auctioningToken and biddingToken is needed in many many components. All of them use the useAuctionDetails hooks. Hence, the api call from within the hooks is triggered very often(over 11 times per site load), as the disjoint components all load it themselves.

I see to ways to fix it:

  1. load the auctionDetails in a higher component and then pass it down to the other components 2.load the aucttionDetails into the app state and let all components pull the information from the app state.

Probably 1. is cleaner, but also more work to refactor. What are your opinions @mariano-aguero and others?

mariano-aguero commented 3 years ago

I think 1 is the best option for me, more cleaner and easy to refactor too

ramirotw commented 3 years ago

Related to https://github.com/gnosis/ido-ux/issues/510#issuecomment-855898261