alchemy_lifecycle/
lib.rs

1//! Lifecycle aspects for Alchemy.
2//!
3//! What's a lifecycle? Well, it includes things like delegates (App+Window), 
4//! where they act as hooks for the system to inform you of events. It includes 
5//! things like `Component`s, which instruct your views how to exist.
6//!
7//! It also includes the `RSX` enum, which is what `render()` methods generally
8//! return. It's common enough to multiple crates, and is intricately linked to the
9//! `Component` lifecycle, so it'll live here.
10//!
11//! This crate also includes the diffing and patching system for the widget tree - 
12//! it needs to live with the `Component` lifecycle to enable state updating.
13
14pub use std::sync::Arc;
15
16use alchemy_styles::lazy_static;
17
18pub mod error;
19pub mod rsx;
20pub mod traits;
21
22mod reconciler;
23use reconciler::RenderEngine;
24pub use reconciler::key::ComponentKey;
25
26lazy_static! {
27    pub static ref RENDER_ENGINE: RenderEngine = RenderEngine::new();
28}
29
30#[macro_export]
31macro_rules! text {
32    ($t:expr) => {
33        alchemy::RSX::text($t)
34    };
35    ($format:tt, $($tail:expr),*) => {
36        alchemy::RSX::text(format!($format, $($tail),*))
37    };
38}