mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-18 16:43:21 +00:00
f5683a2346
Worked a bit on adding more examples. Trying out a new "antipattern" example to show how *not* to use Dioxus.
23 lines
577 B
Rust
23 lines
577 B
Rust
fn main() {}
|
|
|
|
pub mod dioxus {
|
|
pub mod prelude {
|
|
pub trait Properties {
|
|
type Builder;
|
|
fn builder() -> Self::Builder;
|
|
unsafe fn memoize(&self, other: &Self) -> bool;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// This implementation should require a "PartialEq" because it memoizes (no external references)
|
|
#[derive(PartialEq, dioxus_core_macro::Props)]
|
|
struct SomeProps {
|
|
a: String,
|
|
}
|
|
|
|
/// This implementation does not require a "PartialEq" because it does not memoize
|
|
#[derive(dioxus_core_macro::Props)]
|
|
struct SomePropsTwo<'a> {
|
|
a: &'a str,
|
|
}
|