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

Add Transformer impls to handle handle Option<T> properties #878

Merged
merged 3 commits into from
Jan 19, 2020
Merged

Add Transformer impls to handle handle Option<T> properties #878

merged 3 commits into from
Jan 19, 2020

Conversation

AlephAlpha
Copy link
Contributor

Fix #768

For a component Foo with property:

#[derive(Properties)]
pub struct Props {
    pub string: Option<String>
    pub bars: Option<Vec<Bar>>
}

We will be able to write <Foo string="string" bars=vec![] />, which is equivalent to <Foo string=Some("string".to_owned()) bars=Some(vec![]) />. <Foo bars=None /> is still <Foo bars=None />.

@jstarry
Copy link
Member

jstarry commented Jan 19, 2020

Looks great, thanks for all adding all the tests!

@jstarry jstarry merged commit 3195b50 into yewstack:master Jan 19, 2020
llebout pushed a commit to llebout/yew that referenced this pull request Jan 20, 2020
…#878)

* Add Transformer impls to handle handle Option<T> properties

* Add test

* More tests
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.

yew-macro: Handling of Option<T> properties
2 participants