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 specyfing string subtype for product ids #1089

Conversation

AmauryLiet
Copy link
Member

Issue

I want to protect myself by restraining the acceptable skus in my application (either with type ItemSku = 'sku1' | 'sku2' | ... or enum ItemSku { sku1 = 'sku1', sku2 = 'sku2', ... }

However, getProducts returns products with productId typed as string

Fix

getProducts now infers the type of productId from its input

This is backward compatible as the typing is optionnal and defaults to the current string

Copy link
Member

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hyochan hyochan merged commit d3b7707 into dooboolab-community:master Sep 14, 2020
@hyochan hyochan added the ❄️ types Typing issues label Sep 14, 2020
@AmauryLiet AmauryLiet deleted the types/enable-productId-custom-typing branch September 14, 2020 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❄️ types Typing issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants