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

feat: allow matching on unions of string literals #148

Merged
merged 7 commits into from
Sep 24, 2022

Conversation

jasonkuhrt
Copy link
Owner

@jasonkuhrt jasonkuhrt commented Sep 24, 2022

Enhances Alge.match to be able to work with unions of string literals. Example of what is not possible:

const randomThing = pickRandom(['lego', 'basketball', 'videoGame'])
const sentence = Alge.match(randomThing)
  .lego(() => `Got Lego!`)
  .basketball(() => `Got Basketball`)
  .videoGame(() => `Got video game!`)
  .done()

@jasonkuhrt jasonkuhrt merged commit 215caaf into main Sep 24, 2022
@jasonkuhrt jasonkuhrt deleted the feat/string-literal-union-matching branch September 24, 2022 13:15
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.

1 participant