-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Maintain activeCurrency in CurrencyRateController state #22
Conversation
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 comment then this looks good.
@@ -85,31 +84,31 @@ export class CurrencyRateController extends BaseController<CurrencyRateConfig, C | |||
* @param currency - ISO 4217 currency code | |||
*/ | |||
set currency(currency: string) { | |||
this.activeCurrency = currency; | |||
this.update({ currentCurrency: currency }); |
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.
Since currency
is now maintained as state, it doesn't need a getter at all. This whole method can go away now (and the associated tests.) Instead, downstream modules would pass in a new (or initial) currency by setting state.
Closing in favor of #30, which includes more related cleanup. |
* 'main' of github.com:rickycodes/controllers: 32.0.4 (#22)
* 3.0.0 * Update changelog Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
This PR allows to maintain
activeCurrency
inCurrencyRateController
in order to persist information incurrentCurrency
state when the controller is disabled and enabled again.