Skip to content

Commit b9634cf

Browse files
authored
feat: Rename ListenerV2 export to StateChangeListener (#6339)
## Explanation The `ListenerV2` export of the `next` version of `BaseController` has been renamed to `StateChangeListener`. ## References Fixes #6338 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
1 parent a750645 commit b9634cf

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

packages/base-controller/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Note that this should generally not be used, and further breaking changes may be made under this export without a corresponding major version bump for this package.
1414
- Changes:
1515
- Update `BaseController` type and constructor to require new `Messenger` from `@metamask/messenger` rather than `RestrictedMessenger` ([#6318](https://github.com/MetaMask/core/pull/6318))
16+
- Rename `ListenerV2` type export to `StateChangeListener` ([#6339](https://github.com/MetaMask/core/pull/6339))
1617

1718
### Changed
1819

packages/base-controller/src/next/BaseController.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ export type StateConstraint = Record<string, Json>;
5050
* @param patches - A list of patches describing any changes (see here for more
5151
* information: https://immerjs.github.io/immer/docs/patches)
5252
*/
53-
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
54-
// eslint-disable-next-line @typescript-eslint/naming-convention
55-
export type Listener<T> = (state: T, patches: Patch[]) => void;
53+
export type StateChangeListener<T> = (state: T, patches: Patch[]) => void;
5654

5755
/**
5856
* An function to derive state.

packages/base-controller/src/next/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type {
22
BaseControllerInstance,
3-
Listener as ListenerV2,
3+
StateChangeListener,
44
StateConstraint,
55
StateDeriver,
66
StateDeriverConstraint,

0 commit comments

Comments
 (0)