MetaMask / MetaMask/metamask-extension

[State Sync Redesign 3.4] Implement `useControllerSelector` compatibility hook

Open
#40,041 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

INVALID-ISSUE-TEMPLATE team-extension-platform
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

  1. Create ui/hooks/useControllerSelector.ts
  2. Define ControllerSelector type with optional controllerDeps
  3. 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.