Feat: update fc_macro

This commit is contained in:
Jonathan Kelley committed 2021-01-21 02:25:44 -05:00
1 parent 6aeea9b790
commit 28ac37a8b2
12 files changed
+353 -230

No files matched your search

+1
View File
@@ -9,3 +9,4 @@ description = "Core functionality for Dioxus - a concurrent renderer-agnostic Vi
[dependencies]
dioxus-core = { path = "../core", version = "0.1.0" }
dioxus-core-macro = { path = "../core-macro", version = "0.1.0" }
+1 -49
View File
@@ -1,57 +1,9 @@
pub mod prelude {
pub use dioxus_core::prelude::*;
pub use dioxus_core_macro::fc;
}
use dioxus_core::prelude::FC;
// Re-export core completely
pub use dioxus_core as core;
struct App {}
impl App {
fn at(&mut self, pat: &str) -> Route {
todo!()
}
// start the app in a new thread
// pass updates to it via state manager?
fn start(self) {}
}
fn new() -> App {
todo!()
}
struct Router {}
struct Route {}
struct RouteInfo {}
impl RouteInfo {
fn query<T>(&self) -> T {
todo!()
}
}
impl Route {
fn serve(&self, app: FC<RouteInfo>) {}
}
#[cfg(test)]
mod test {
use super::*;
use crate::prelude::*;
#[test]
fn app_example() {
let mut app = crate::new();
app.at("/").serve(|ctx| {
let parsed: u32 = ctx.props.query();
html! { <div>"hello " </div> }
});
app.start();
}
}