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

Required options #2

Open
scottcorgan opened this issue Aug 3, 2017 · 3 comments
Open

Required options #2

scottcorgan opened this issue Aug 3, 2017 · 3 comments

Comments

@scottcorgan
Copy link

Idea


@joeosburn-desiringgod recommended I open these ideas here.

It's pretty helpful to be able to declare some options to be passed into the component as required. By default, they would be optional. This helps ensure that the errors don't send us in the wrong direction. This especially happens when we have nested components.

Example:

<%= icon(type: 'arrow') %>

Here, type is required because anything else doesn't make sense (there is no default value for this one). Display some sort of error like "The component 'icon' requires type to be defined" (or something similar) would make our components easier to use and learn.

@ghost
Copy link

ghost commented Aug 16, 2017

I'm good with implementing this.

@benhutton Are you good with this? I'm about to dive into implementing this.

@benhutton
Copy link
Member

@joeosburn-desiringgod yeah. Seems like it should be done in conjunction with #5, or at least with the API for #5 in mind, right?

@ghost
Copy link

ghost commented Aug 17, 2017

@benhutton Yes! Though, at this point, I'm thinking the implementation of the two will be very different and probably unrelated. However, I'll get to that once I have a firm idea in mind.

@ghost ghost mentioned this issue Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants