-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 extend method to Classes #626
Conversation
Random thought: maybe |
I think |
Yeah, I'm flip-floping hard on this minor detail. I think |
Maybe something like this is possible for .new() constructor? |
We already have What this PR is targeting is the scenario where you want to pass |
Great, i didnt know about that! Missed in docs :( |
src/virtual_dom/mod.rs
Outdated
@@ -17,6 +17,7 @@ pub use self::vnode::VNode; | |||
pub use self::vtag::VTag; | |||
pub use self::vtext::VText; | |||
use crate::html::{Component, Scope}; | |||
use std::ops::RangeFull; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
bors r+ |
626: Add extend method to Classes r=jstarry a=hgzimmerman Also implement Clone. Addresses #621 ---- I'm a little off-put by the use of `format!()` having to be used to concatenate strings that are later used as classes. This change allows for usages like: ```rust html!{ <div class=Classes::new().union("some-class").union("other-class") /> } ``` or ```rust html!{ <div class=self.class.clone().union("other-class") /> } ``` Co-authored-by: Henry Zimmerman <zimhen7@gmail.com>
Build succeeded
|
Also implement Clone.
Addresses #621
I'm a little off-put by the use of
format!()
having to be used to concatenate strings that are later used as classes.This change allows for usages like:
or