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

value behavior does not type-check nor convert resolved values #152

Open
bmomberger-bitovi opened this issue Nov 22, 2019 · 4 comments
Open
Labels
discussion Open ended discussion about the library and its design

Comments

@bmomberger-bitovi
Copy link

https://codepen.io/bmomberger-bitovi/pen/OJJGZZq

This should at very least warn in dev mode. Ideally it should have the same type checking as when the property is set externally.

@bmomberger-bitovi bmomberger-bitovi added the bug Something isn't working label Nov 22, 2019
@phillipskevin
Copy link
Contributor

Type checking happens when the property is set, so errors are thrown if you set the prop instead of propValue.

@bmomberger-bitovi
Copy link
Author

I don't see the two being mutually exclusive. We had the same discussion about type and default (when it was called value) ages ago, and I think that the principles still apply here.

@phillipskevin
Copy link
Contributor

So you think we should type check twice? Type check when the value is set and type check when resolve is called?

@bmomberger-bitovi
Copy link
Author

Yes, either twice, or only when resolve is called when a value behavior exists.

Alternatively we could pass type as a function parameter to the value behavior. But my gut instinct is that the flexibility to call the type checker/converter whenever isn't more beneficial than the simplicity of leaving it as declarative.

@phillipskevin phillipskevin added discussion Open ended discussion about the library and its design and removed bug Something isn't working labels Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Open ended discussion about the library and its design
Projects
None yet
Development

No branches or pull requests

2 participants