Skip to content

use Proxy for TaggedEnum constructors#1560

Merged
tim-smart merged 3 commits intomainfrom
taggedenum-proxy
Oct 24, 2023
Merged

use Proxy for TaggedEnum constructors#1560
tim-smart merged 3 commits intomainfrom
taggedenum-proxy

Conversation

@tim-smart
Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 24, 2023

🦋 Changeset detected

Latest commit: a5bab07

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
effect Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mikearnaldi
Copy link
Copy Markdown
Member

We may want to change:

const Result = Data.taggedEnum<ResultDefinition>()
const Success = Result.Success
const Failure = Result.Failure

to:

const { Success, Failure } = Data.taggedEnum<ResultDefinition>()

as a convention

@tim-smart
Copy link
Copy Markdown
Contributor Author

Sounds good. I added back support for the previous syntax - but I feel like the api is too complex with both.

@tim-smart
Copy link
Copy Markdown
Contributor Author

Sounds good. I added back support for the previous syntax - but I feel like the api is too complex with both.

Yeah if we push for destructuring as the recommended usage pattern, I think dropping the function constructors is reasonable.

@mikearnaldi
Copy link
Copy Markdown
Member

Sounds good. I added back support for the previous syntax - but I feel like the api is too complex with both.

Yeah if we push for destructuring as the recommended usage pattern, I think dropping the function constructors is reasonable.

I kind of agree yeah

@tim-smart tim-smart merged commit 1395dc5 into main Oct 24, 2023
@tim-smart tim-smart deleted the taggedenum-proxy branch October 24, 2023 23:30
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

Successfully merging this pull request may close these issues.

2 participants