1mod context;
9mod cx;
10mod dispatch;
11mod engine;
12mod events;
13mod future;
14mod hooks;
15pub mod layout;
16pub mod paint;
17mod state;
18mod store;
19mod view;
20
21pub use context::{provide_context, use_context};
22pub use cx::Cx;
23pub use dispatch::{Dispatch, use_reducer};
24pub use events::{Arity0, Arity1, Emitter, EventSink, Handler};
25pub use future::{SpawnFuture, spawn, use_future};
26pub use hooks::{
27 FnCleanup, IntoCleanup, NoCleanup, use_animate, use_animate_with, use_effect, use_handle,
28 use_memo, use_persisted, use_state,
29};
30pub use layout::{
31 Align, AlignSelf, ContainerStyle, Direction, Display, Gap, ItemStyle, Justify, Length,
32 PaintStyle,
33};
34pub use state::{Handle, State};
35pub use store::{Collision, Store};
36pub use view::{View, view};
37
38pub use egui_reactor_macros::{component, hook, rsx};
39
40pub use taffy;
42
43#[doc(hidden)]
44pub mod __private {
45 pub use typed_builder;
46 pub use typed_builder::TypedBuilder;
47
48 pub trait Props {
50 type Builder;
52 const SHARES_UI: bool = false;
58 fn builder() -> Self::Builder;
60 }
61
62 pub fn enter_scope<P, F, S>(cx: &mut super::Cx<'_, '_>, source: S, props: P, component: F)
67 where
68 P: Props,
69 S: ::core::hash::Hash + ::core::fmt::Debug,
70 F: for<'a, 'b, 'c> Fn(&'a mut super::Cx<'b, 'c>, P),
71 {
72 if P::SHARES_UI {
73 cx.scope_sharing_ui(source, move |cx| component(cx, props));
74 } else {
75 cx.scope(source, move |cx| component(cx, props));
76 }
77 }
78}
79
80pub use __private::Props;
81
82pub fn props_builder<P, F>(_component: &F) -> P::Builder
89where
90 P: Props,
91 F: for<'a, 's, 'u> Fn(&'a mut Cx<'s, 'u>, P),
92{
93 P::builder()
94}
95
96pub mod prelude {
98 pub use crate::context::{provide_context, use_context};
99 pub use crate::cx::Cx;
100 pub use crate::dispatch::{Dispatch, use_reducer};
101 pub use crate::events::{Emitter, EventSink, Handler};
102 pub use crate::future::{spawn, use_future};
103 pub use crate::hooks::{
104 use_animate, use_animate_with, use_effect, use_handle, use_memo, use_persisted, use_state,
105 };
106 pub use crate::layout::{
107 Align, AlignSelf, ContainerStyle, Direction, Display, Gap, ItemStyle, Justify, Length,
108 PaintStyle,
109 };
110 pub use crate::state::{Handle, State};
111 pub use crate::store::{Collision, Store};
112 pub use crate::view::{View, view};
113 pub use egui_reactor_macros::{component, hook, rsx};
114
115 pub use std::task::Poll;
118}