positional async
This commit is contained in:
@@ -319,6 +319,11 @@ impl Children {
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn insert(&mut self, index: usize, element: Element) {
|
||||||
|
if let Children::Children(children, _) = self {
|
||||||
|
children.insert(index, element);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Handler<T> {
|
impl<T> Handler<T> {
|
||||||
|
|||||||
+3
-2
@@ -13,9 +13,10 @@ macro_rules! check_expr {
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! parse_rsx_param {
|
macro_rules! parse_rsx_param {
|
||||||
($elem:expr, async $code:block $($rest:tt)*) => {
|
($elem:expr, async $code:block $($rest:tt)*) => {
|
||||||
|
let elem_len = $elem.children.len();
|
||||||
$elem.instructions.push($crate::Instruction::Load(Handler::new(
|
$elem.instructions.push($crate::Instruction::Load(Handler::new(
|
||||||
|d: &mut Div, _, _| {
|
move |d: &mut Div, _, _| {
|
||||||
d.children.add_child($code);
|
d.children.insert(elem_len, $code);
|
||||||
}
|
}
|
||||||
)));
|
)));
|
||||||
osui::parse_rsx_param!($elem, $($rest)*);
|
osui::parse_rsx_param!($elem, $($rest)*);
|
||||||
|
|||||||
Reference in New Issue
Block a user