Skip to content

Document why Effect is pervasive #13

@pete-murphy

Description

@pete-murphy

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions