Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Explanation As part of the upcoming core wallet library initiative, we plan to migrate all controllers to `BaseControllerV2`. This commit upgrades `ComposableController`. ## References - Closes #2082 - See #1509 ## Changelog ### `@metamask/composable-controller` ## Added - Add types `ComposableControllerState`, `ComposableControllerStateChangeEvent`, `ComposableControllerEvents`, `ComposableControllerMessenger`. ## Changed - **BREAKING:** `ComposableController` is upgraded to extend `BaseControllerV2`. - The constructor now expects an options object with required properties `controllers` and `messenger` as its only argument. - `ComposableController` no longer has a `subscribe` method. Instead, listeners for `ComposableController` events must be registered to the controller messenger that generated the restricted messenger assigned to the instance's `messagingSystem` class field. - Any getters for `ComposableController` state that access the internal class field directly should be refactored to instead use listeners that are subscribed to `ComposableControllerStateChangeEvent`. ## 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 highlighted breaking changes using the "BREAKING" category above as appropriate --------- Co-authored-by: Ellilot Winkler <[email protected]>
- Loading branch information