richardfogaca commented on code in PR #36416:
URL: https://github.com/apache/superset/pull/36416#discussion_r2695723588
##########
superset-frontend/packages/superset-ui-core/src/currency-format/CurrencyFormatter.ts:
##########
@@ -49,7 +81,9 @@ class CurrencyFormatter extends ExtensibleFunction {
currency: Currency;
constructor(config: CurrencyFormatterConfig) {
- super((value: number) => this.format(value));
+ super((value: number, rowData?: RowData, currencyColumn?: string) =>
+ this.format(value, rowData, currencyColumn),
+ );
Review Comment:
Thanks for the suggestion! Unfortunately, these aren't quite equivalent due
to timing. When super() is called, this.format doesn't exist yet since super()
must complete before this is accessible. Using this.format.bind(this) would
evaluate this.format immediately (resulting in undefined), whereas the arrow
function defers the lookup until the function is actually invoked, by which
point the instance is fully constructed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]