Skip to content

Better support multiple currencies with the same format options #44

@dpolivy

Description

@dpolivy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions