vulpemventures / marina

Liquid Wallet browser extension
MIT License
37 stars 19 forks source link

move `useSelectTransations` logic to `StorageContext` #448

Closed louisinger closed 1 year ago

louisinger commented 1 year ago

This PR drops the useSelectTransactions hook used in transactions view and compute the transactions list from repositories inside the StorageContext component. It lets to:

the PR also use that newly cached transactions list to filter the asset in Home view. it closes #437

@tiero @bordalix please review this

louisinger commented 1 year ago

It may be a non-issue, but does having these injected via Context causing re-rendering al all child components everytime a new tx is computed?

From my React understanding, only the components using the prop cache.transactions will be re-rendered.

tiero commented 1 year ago

nly the components using the prop

yep, I did not review the code but want to make sure we confirm we not introducing unnecessary re-renders

louisinger commented 1 year ago

yep, I did not review the code but want to make sure we confirm we not introducing unnecessary re-renders

To be honest if think it's equivalent in terms of react rendering but for sure it reduces the number of repository calls

tiero commented 1 year ago

Can you fix conflicts @louisinger ?