-
Notifications
You must be signed in to change notification settings - Fork 0
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
Default Option Values Support #10
Conversation
@scottcorgan @shanebo Check out the example implementation here:
|
@joeosburn-desiringgod how do you see required options (#2) fitting into this API? |
|
@joeosburn-desiringgod wouldn't |
@benhutton Yes, but I'd still leave the api like this. |
@joeosburn-desiringgod I like the API for |
@joeosburn-desiringgod I'm all about throwing errors so we know exactly the mistake we made. Makes for low cognitive load 👍 |
@joeosburn-desiringgod @benhutton @scottcorgan I'm trying to think through when we'd ever have a required key that doesn't have a default value. Also if we didn't pass in a required key, wouldn't it throw anyway? If so, why bloat the component code to cover something that will already error out? Is it only to get cleaner error messages? |
@shanebo a required option would never have a default value, because it's required. An error should be thrown if that option is not given to the component. Default values are for options that are, sigh, optional. Which, @joeosburn-desiringgod, begs the question, maybe |
a3c881a
to
62df8e4
Compare
62df8e4
to
dbc30ad
Compare
Closing in favor of #20 |
@benhutton This is one potential solution to address Issue #5. This is not originally what I was going to go with, but I think it provides a relatively straight forward solution that will be easy to build on and add support for #2.
Another approach would be to simply except Component developers to have their action method insert default values, but I'm guessing that is not what @desiringgod/frontend is looking for.