Uniswap / Uniswap/interface

consider turning our hooks that contain heavy processing into 'singleton' hooks

Open
#2,624 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

we can use singleton hooks to limit the processing of state pulled from redux stores (e.g. via useContract...) to happen only once, not per component

https://www.npmjs.com/package/react-singleton-hook
https://bundlephobia.com/package/react-singleton-hook

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating hooks that pull processed state from Redux, especially useContract, then read the react-singleton-hook documentation and inspect how those hooks are used across components. Done should mean an agreed set of hooks has been evaluated and the selected processing is safely shared rather than repeated per component.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, redux, typescript
Domain
frontend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.