improved documentation and refactored naming to be more self-explanatory
This commit is contained in:
1 parent
e4d60c8dfc
commit
adfbb6c380
91 files changed
+1663
-1553
No files matched your search
@@ -43,14 +43,15 @@ const RECT_STYLE: &str = r#"
|
||||
fn app(cx: Scope) -> Element {
|
||||
let events = use_ref(cx, std::collections::VecDeque::new);
|
||||
|
||||
let log_event = move |event: Event| {
|
||||
let mut events = events.write();
|
||||
let log_event =
|
||||
move |event: Event| {
|
||||
let mut events = events.write();
|
||||
|
||||
if events.len() >= MAX_EVENTS {
|
||||
events.pop_front();
|
||||
}
|
||||
events.push_back(event);
|
||||
};
|
||||
if events.len() >= MAX_EVENTS {
|
||||
events.pop_front();
|
||||
}
|
||||
events.push_back(event);
|
||||
};
|
||||
|
||||
cx.render(rsx! (
|
||||
div {
|
||||
|
||||
Reference in new issue
Block a user