Skip to content

Commit 109cda3

Browse files
authored
chore(base-controller): Restore subscrbe property (#3698)
## Explanation The `subscribe` property was removed in #3590 because it is no longer used. It has been restored here so that we can release the `@metamask/base-controller` without any breaking changes. This property's description has been updated to clarify that it's no longer used, and it's now marked as deprecated. ## References Discussed in the v104 release candidate PR: #3695 (comment) ## Changelog ### `@metamask/base-controller` - Changed: Deprecate the `subscribe` property of `BaseControllerV2` - This property was used to differentiate between `BaseControllerV1` and `BaseControllerV2` controllers. It is no longer used, so it has been marked as deprecated. ## 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
1 parent ca4baa0 commit 109cda3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/base-controller/src/BaseControllerV2.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ export class BaseController<
113113

114114
public readonly metadata: StateMetadata<ControllerState>;
115115

116+
/**
117+
* The existence of the `subscribe` property is how the ComposableController used to detect
118+
* whether a controller extends the old BaseController or the new one. We set it to `undefined` here to
119+
* ensure the ComposableController never mistakes them for an older style controller.
120+
*
121+
* This property is no longer used, and will be removed in a future release.
122+
*
123+
* @deprecated This will be removed in a future release
124+
*/
125+
public readonly subscribe: undefined;
126+
116127
/**
117128
* Creates a BaseController instance.
118129
*

0 commit comments

Comments
 (0)