♻️ (bootsier, htmx): Adapta ciclo de render async
Añade `#[async_trait]` a todos los `impl Extension`, `Theme` y `Component`. Convierte `prepare()` en `async fn` y añade `.await` a las llamadas `render()` y `render_offcanvas()`.
This commit is contained in:
parent
9354894b3a
commit
1139df6210
17 changed files with 68 additions and 42 deletions
|
|
@ -44,6 +44,7 @@ pub struct Nav {
|
|||
items: Children,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Component for Nav {
|
||||
fn new() -> Self {
|
||||
Self::default()
|
||||
|
|
@ -63,8 +64,8 @@ impl Component for Nav {
|
|||
}));
|
||||
}
|
||||
|
||||
fn prepare(&self, cx: &mut Context) -> Result<Markup, ComponentError> {
|
||||
let items = self.items().render(cx);
|
||||
async fn prepare(&self, cx: &mut Context) -> Result<Markup, ComponentError> {
|
||||
let items = self.items().render(cx).await;
|
||||
if items.is_empty() {
|
||||
return Ok(html! {});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue