yew_stdweb/html/component/properties.rs
//! Component properties module
pub use yew_macro::Properties;
/// Trait for building properties for a component
pub trait Properties: Clone {
/// Builder that will be used to construct properties
type Builder;
/// Entrypoint for building properties
fn builder() -> Self::Builder;
}
/// Builder for when a component has no properties
#[derive(Debug)]
#[doc(hidden)]
pub struct EmptyBuilder;
impl Properties for () {
type Builder = EmptyBuilder;
fn builder() -> Self::Builder {
EmptyBuilder
}
}
impl EmptyBuilder {
/// Build empty properties
pub fn build(self) {}
}