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

Allow optional parameters in components #804

Closed
watzon opened this issue Jun 13, 2019 · 2 comments
Closed

Allow optional parameters in components #804

watzon opened this issue Jun 13, 2019 · 2 comments
Milestone

Comments

@watzon
Copy link

watzon commented Jun 13, 2019

Currently any needs parameter that gets included in a Component makes that a required parameter when using mount. It would be nice if there was either

  • a wants macro that defines an optional parameter
  • the ability to have it determine that any nillable needs parameter is optional

Example

needs user : User?

# or

wants user : User
@paulcsmith
Copy link
Member

I think needs user : User? is good so we don't have to introduce a new concept. This kind of matches the behavior of getter user : User? where the default is nil even though you don't need to specify it. Thank you for opening this!

@paulcsmith paulcsmith added this to the Lucky next milestone Jun 13, 2019
@watzon
Copy link
Author

watzon commented Jun 13, 2019

No problem :)

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

No branches or pull requests

2 participants