Skip to content

Commit

Permalink
Try new elm-inspired design
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Jan 27, 2024
1 parent 0a01b18 commit a2efde2
Show file tree
Hide file tree
Showing 15 changed files with 2 additions and 695 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resolver = "2"
members = [
"crates/concoct",
"crates/concoct-web",
# "crates/concoct-web",
# "crates/concoct-menu",
"web_examples/counter"
# "web_examples/counter"
]
36 changes: 0 additions & 36 deletions crates/concoct/src/action.rs

This file was deleted.

27 changes: 0 additions & 27 deletions crates/concoct/src/handle.rs

This file was deleted.

13 changes: 0 additions & 13 deletions crates/concoct/src/hook/mod.rs

This file was deleted.

9 changes: 0 additions & 9 deletions crates/concoct/src/hook/use_context.rs

This file was deleted.

17 changes: 0 additions & 17 deletions crates/concoct/src/hook/use_on_drop.rs

This file was deleted.

12 changes: 0 additions & 12 deletions crates/concoct/src/hook/use_provider.rs

This file was deleted.

30 changes: 0 additions & 30 deletions crates/concoct/src/hook/use_ref.rs

This file was deleted.

64 changes: 0 additions & 64 deletions crates/concoct/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,65 +1 @@
//! Concoct is a framework for user-interfaces in Rust.
//!
//! This crate provides a virtual DOM and state management system for any backend.
//! Concoct uses static typing to describe your UI at compile-time to create an efficient
//! tree without allocations.
//!
//! ```ignore
//! use concoct::{Scope, View};
//! use concoct_web::html;
//!
//! #[derive(Default)]
//! struct Counter {
//! count: i32,
//! }
//!
//! impl View<Self> for Counter {
//! fn body(&mut self, _cx: &Scope<Self>) -> impl View<Self> {
//! (
//! format!("High five count: {}", self.count),
//! html::button("Up high!").on_click(|_cx, state: &mut Self, _event| state.count += 1),
//! html::button("Down low!").on_click(|_cx, state: &mut Self, _event| state.count -= 1),
//! )
//! }
//! }
//!
//! fn main() {
//! concoct_web::launch(Counter::default())
//! }
//! ```
//!

#![deny(missing_docs)]

use std::ops::DerefMut;

mod action;
pub use self::action::{Action, IntoAction};

mod handle;
pub use self::handle::Handle;

pub mod hook;

mod vdom;
pub use self::vdom::VirtualDom;

pub mod view;
pub use self::view::View;

mod scope;
pub use self::scope::Scope;

/// Run a view on a new virtual dom.
pub async fn run<T, V>(content: V)
where
T: 'static,
V: View<T> + DerefMut<Target = T>,
{
let mut vdom = VirtualDom::new(content);
vdom.build();

loop {
vdom.rebuild().await;
}
}
98 changes: 0 additions & 98 deletions crates/concoct/src/scope.rs

This file was deleted.

Loading

0 comments on commit a2efde2

Please sign in to comment.