coinbase / onchainkit

React components and TypeScript utilities to help you build top-tier onchain apps.

Home Page:https://onchainkit.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Batch and throttle useOnchainActionWithCache

kyhyco opened this issue · comments

Describe the solution you'd like

Running into an issue on build-onchain-apps where useAvatar attempts to render 100+ avatars. This fires 100+ network requests. When network requests fail for whatever reason, on every render it triggers another 100+ requests. Eventually you get too many request errors.

Batching + throttling these requests would be amazing.

On too many request errors, we should halt the requests if possible.

Describe alternatives you've considered.

No response

@alvaroraminelli can we prioritize this fix as P0, also, I am seriously considering if we should use @tanstack/react-query for OnchainKit. I know in the past I was against that. But I think our proximity to wagmi as OchainKit complement, makes me reflect a lot that if they use it, we should use it too.