Skip to content

Commit

Permalink
chore(base-controller): Restore subscrbe property
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gudahtt committed Dec 22, 2023
1 parent 247890e commit bd2214b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/base-controller/src/BaseControllerV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ export class BaseController<

public readonly metadata: StateMetadata<ControllerState>;

/**
* The existence of the `subscribe` property is how the ComposableController used to detect
* whether a controller extends the old BaseController or the new one. We set it to `undefined` here to
* ensure the ComposableController never mistakes them for an older style controller.
*
* This property is no longer used, and will be removed in a future release.
*
* @deprecated This will be removed in a future release
*/
public readonly subscribe: undefined;

/**
* Creates a BaseController instance.
*
Expand Down

0 comments on commit bd2214b

Please sign in to comment.