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

Clearer api for working with masked or unmasked value #96

Open
brandynbennett opened this issue Jan 30, 2019 · 0 comments
Open

Clearer api for working with masked or unmasked value #96

brandynbennett opened this issue Jan 30, 2019 · 0 comments

Comments

@brandynbennett
Copy link
Collaborator

Right now it's very confusing when to pass an unmasked value or a masked value to the component. I'm thinking it would be better if users of the component were explicit about which value they cared to work with. An API I think might be good would be something like this:

<OneWayNumberMask @maskedValue=foo @update={{action (mut foo)}} />

In this scenario the developer passed the maskedValue in and so the update action would return the maskedValue as the first argument and the unmaskedValue as the 2nd argument.

<OneWayNumberMask @unmaskedValue=foo @update={{action (mut foo)}} />

In this scenario the developer passed the unmaskedValue in and so the update action would return the unmaskedValue as the first argument and the maskedValue as the 2nd argument.

It would be an error to pass both the unmaskedValue and maskedValue to the component.

We would deprecate passing value in as a positional param to help move developers to being explicit about which type of format they want to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant