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

Document why Effect is pervasive #13

Open
pete-murphy opened this issue Jul 30, 2023 · 0 comments
Open

Document why Effect is pervasive #13

pete-murphy opened this issue Jul 30, 2023 · 0 comments

Comments

@pete-murphy
Copy link
Owner

pete-murphy commented Jul 30, 2023

Maybe this could be documented in README, I imagine this question might come up. Let's say as a user, I'd like to be able to use this library in pure code to format a DateTime as String. You can't currently do that—the DateTimeFormat.new constructor returns in Effect because if none of the Locales passed in are supported it will fall back to the host machine's default locale. Same applies for other service constructors.

For example, "yue" is the language tag for Cantonese, but at time of writing the DateTimeFormat implementation in Chrome (115) does not support it, so the locale resolves to "en-US" on my machine.

const dateTimeFormat = new Intl.DateTimeFormat("yue")
dateTimeFormat.resolvedOptions().locale // "en-US"
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