wip: docs
Worked a bit on adding more examples. Trying out a new "antipattern" example to show how *not* to use Dioxus.
This commit is contained in:
1 parent
9d7ee79826
commit
f5683a2346
9 files changed
+197
-174
No files matched your search
@@ -2,18 +2,21 @@ fn main() {}
|
||||
|
||||
pub mod dioxus {
|
||||
pub mod prelude {
|
||||
pub unsafe trait Properties {
|
||||
pub trait Properties {
|
||||
type Builder;
|
||||
const CAN_BE_MEMOIZED: bool;
|
||||
fn builder() -> Self::Builder;
|
||||
unsafe fn memoize(&self, other: &Self) -> bool;
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(dioxus_core_macro::Props)]
|
||||
|
||||
/// 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,
|
||||
|
||||
Reference in new issue
Block a user