use pakem::prelude::Application;
use crate::component::LiveComponent;
use crate::registry::LiveRegistry;
pub trait LiveApplicationExt {
fn with_live(self) -> Self;
fn with_live_component<T: LiveComponent>(self, name: &str) -> Self;
}
impl LiveApplicationExt for Application {
fn with_live(self) -> Self {
crate::init();
self.with_raw_router(crate::routes())
}
fn with_live_component<T: LiveComponent>(self, name: &str) -> Self {
crate::init();
LiveRegistry::global().register::<T>(name);
self
}
}