MetaMask / MetaMask/metamask-extension
[State Sync Redesign 3.4] Implement `useControllerSelector` compatibility hook
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
Create a compatibility hook that reads selector.controllerDeps to narrow subscription scope, falling back to all controllers if unset.
function useControllerSelector(selector: ControllerSelector): R
Steps
- Create
ui/hooks/useControllerSelector.ts - Define
ControllerSelectortype with optionalcontrollerDeps - Unit tests with single-controller, multi-controller, and fallback scenarios
Files
ui/hooks/useControllerSelector.ts
Dependencies
Issue 3.1
Context
Part of [State Sync Redesign — Epic 3: UI-controller subscriptions].
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed entry point in ui/hooks/useControllerSelector.ts and review the Issue 3.1 dependency for the selector context. Define the ControllerSelector type and cover single-controller, multi-controller, and fallback behavior with unit tests; done means the hook narrows subscriptions when controllerDeps is set and otherwise uses all controllers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100