feat: massage lifetimes

This commit is contained in:
Jonathan Kelley committed 2021-10-16 17:37:28 -04:00
1 parent 16dbf4a6f8
commit 9726a065b0
92 files changed
+250 -241

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ fn main() {
println!("{}", dom);
}
pub static EXAMPLE: FC<()> = |cx, _| {
pub static EXAMPLE: FC<()> = |(cx, _)| {
let list = (0..10).map(|_f| LazyNodes::new(move |_f| todo!()));
cx.render(LazyNodes::new(move |cx| {
+1 -1
View File
@@ -5,7 +5,7 @@ fn main() {
dom.rebuild();
}
const App: FC<()> = |cx, props| {
const App: FC<()> = |(cx, props)| {
let id = cx.scope_id();
cx.submit_task(Box::pin(async move { id }));
+1 -1
View File
@@ -6,7 +6,7 @@ struct SomeContext {
}
#[allow(unused)]
static Example: FC<()> = |cx, props| {
static Example: FC<()> = |(cx, props)| {
todo!()
// let value = cx.use_context(|c: &SomeContext| c.items.last().unwrap());
+3 -2
View File
@@ -1,3 +1,4 @@
use dioxus::component::Component;
use dioxus::events::on::MouseEvent;
use dioxus_core as dioxus;
use dioxus_core::prelude::*;
@@ -12,7 +13,7 @@ fn main() {
assert!(g.edits.len() > 1);
}
static App: FC<()> = |cx, props| {
static App: FC<()> = |(cx, props)| {
let mut rng = SmallRng::from_entropy();
let rows = (0..10_000_usize).map(|f| {
let label = Label::new(&mut rng);
@@ -37,7 +38,7 @@ struct RowProps {
row_id: usize,
label: Label,
}
fn Row<'a>(cx: Context<'a>, props: &'a RowProps) -> DomTree<'a> {
fn Row((cx, props): Component<RowProps>) -> DomTree {
let handler = move |evt: MouseEvent| {
let g = evt.button;
};
+1 -1
View File
@@ -4,7 +4,7 @@ use dioxus_core::prelude::*;
#[async_std::main]
async fn main() {
static App: FC<()> = |cx, props| cx.render(LazyNodes::new(|f| f.text(format_args!("hello"))));
static App: FC<()> = |(cx, props)| cx.render(LazyNodes::new(|f| f.text(format_args!("hello"))));
let mut dom = VirtualDom::new(App);