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

Adds internal method to Config #207

Merged
merged 2 commits into from
Feb 7, 2017

Conversation

mthadley
Copy link

@mthadley mthadley commented Feb 7, 2017

I noticed internal was missing. Thanks!

@mthadley
Copy link
Author

mthadley commented Feb 7, 2017

After thinking about this, I realized that this flag only makes sense for specific renderers. In this case , IncrementalDOMRenderer. Even then, it's only useful for Soy. Compare that to the other methods like required and value which make sense for all renderers. We could still add this, but now I'm thinking it might make more sense to add some kind of custom method instead?

So it could work like this:

MyComponent.STATE = {
  name: Config.string().value('test').custom('internal', true)
}

So custom would have a signature like custom(name : string, value : any).

@yuchi
Copy link
Contributor

yuchi commented Feb 7, 2017

or…

MyComponent.STATE = {
  name: {
    internal: true,
    ...Config.string().value('test')
  }
}

@eduardolundgren
Copy link
Contributor

@mthadley Would be good to expose on Config any valid configuration of State, the pull request looks good to me.

Everyone else is fine with the addition?

Thank you.

@mthadley
Copy link
Author

mthadley commented Feb 7, 2017

Yea, that's ok. Just thought I would add an alternative solution. If you like it, I'm fine with merging it. @eduardolundgren

@eduardolundgren eduardolundgren merged commit 4e41609 into metal:master Feb 7, 2017
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

Successfully merging this pull request may close these issues.

3 participants