You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently countries are listed in key/values with the country code being used as key, but not present in the value object.
This leads to problems when, for example, allowing a user to choose from a list of countries, it is easy to get all countries using Object.values, but then each value does not have its own code.
I would love to make a PR, but don't know where to start? I think we could just update the script (not the data file), to map over all entries just to include the code.
The text was updated successfully, but these errors were encountered:
Yes but then, later, we handle just a Country object without the code, otherwise we need to reconstruct a new object from the country and code prop. Seems overkill for a simple property that won't take that much of size in my opinion.
But ok thanks anyway
@philippeauriach it makes total sense, have it in my list as well. But thinking rather on a getter that returns an object of a Country class, with code and maybe some additional features in future. Need to finish that TypeScript migration already. Mainly, not merging that because have doubts on some future structures. You may check the PR #83 as well, by the way.
Use case for the feature
Currently countries are listed in key/values with the country code being used as key, but not present in the value object.
This leads to problems when, for example, allowing a user to choose from a list of countries, it is easy to get all countries using
Object.values
, but then each value does not have its own code.I would love to make a PR, but don't know where to start? I think we could just update the script (not the data file), to map over all entries just to include the code.
The text was updated successfully, but these errors were encountered: