Skip to content
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

Better support multiple currencies with the same format options #44

Open
dpolivy opened this issue Jul 14, 2020 · 0 comments
Open

Better support multiple currencies with the same format options #44

dpolivy opened this issue Jul 14, 2020 · 0 comments

Comments

@dpolivy
Copy link

dpolivy commented Jul 14, 2020

Creating a new issue that is related to some discussion I saw in #10 to talk about having the compiler support automatically "pre-compiling" each currencyFormatter with a pre-set list of currencies provided separately. In cases where the currency may be dynamically chosen, but from a set of known values, it would be much simpler to be able to declare the formatter once, and have the compiler automatically expand this.

A similar behavior could be added for units, which I believe has a similar pattern.

I'm not sure how to implement this, but as far as API goes, having another property on options passed to compile(), such as supportedCurrencies/supportedUnits seems like the right approach. Without this present, the compiler would take the formatters literally, but with them present (or, perhaps with them present with a special sentinel value for currency/units), it would auto-expand and generate individual formatters for each of the passed in currencies/units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant