-
-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(preferences-controller): Convert to BaseControllerV2 #3713
feat(preferences-controller): Convert to BaseControllerV2 #3713
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
a2d6420
to
ab2cb6c
Compare
320415c
to
0ffc8af
Compare
69003d7
to
941bc4e
Compare
941bc4e
to
24e158f
Compare
The `PreferencesController` has been migrated to `BaseControllerV2`. As part of this migration, the unused `name` state property has also been removed. Closes #3708
b92b379
to
e74bd82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, but looks good regardless.
* @returns A PreferencesController instance. | ||
*/ | ||
function setupPreferencesController( | ||
options: Partial<ConstructorParameters<typeof PreferencesController>[0]> = {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: For some other controllers we have an *Options
type that holds the options. Think it's worth it to extract that? I guess this is also fine too, just a bit verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I actually find that pattern makes the code it bit harder to read. I prefer declaring options inline rather than in types declared somewhere else.
Explanation
The
PreferencesController
has been migrated toBaseControllerV2
. As part of this migration, the unusedname
state property has also been removed.References
Closes #3708
Changelog
@metamask/preferences-controller
Changed
BaseControllerV2
messenger
and an optionalstate
property.Checklist