-
Notifications
You must be signed in to change notification settings - Fork 144
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
switch svg and button default to static #584
Conversation
I think zoxc mentioned this a while ago and now I pretty strongly agree with it |
would something like this would be better pub fn svg(svg_str: impl Into<String> + 'static) -> Svg {
let id = ViewId::new();
id.update_state(svg_str);
Svg {
id,
svg_tree: None,
svg_hash: None,
}
.class(SvgClass)
}
impl Svg {
pub fn update(self, svg_str: impl Fn() -> String + 'static) -> Self {
let id = self.id;
create_effect(move |_| {
let new_svg_str = svg_str();
id.update_state(new_svg_str);
});
self
}
} so that we don't have Not sure about the method name |
ah yeah that seems good. I think update makes sense. |
used update_svg as the method to avoid confusing with View update method |
maybe consider using |
or |
👍 |
* switch svg and button default to static * fix linux/clippy * fix tests * button view as child, svg update method * fix linux * rename
No description provided.