Skip to main content

simple_gpui/
lib.rs

1pub use simple_gpui_core::*;
2
3// This macro is not necessarily used, only for dismissing ide errors.
4#[macro_export]
5macro_rules! component_property {
6    ($($t:tt)*) => {
7        unreachable!("component_property! should only be used inside a #[component] or #[component_stateless] function, and in ident: type = expr or ident: type form");
8    };
9}
10
11#[macro_export]
12macro_rules! component_entity {
13    ($($t:tt)*) => {
14        unreachable!("component_entity! should only be used inside a #[component] or #[component_stateless] function, and in ident: type = expr or ident: type form")
15    };
16}
17
18#[macro_export]
19macro_rules! init_with_context {
20    ($($t:tt)*) => {
21        unreachable!("use_context! should only be used inside a #[component] function, and in ident: type = expr or ident: type form");
22    };
23}
24
25#[macro_export]
26macro_rules! subscribe {
27    ($($t:tt)*) => {
28        unreachable!("subscribe! should only be used inside a #[component] function, and in subscribe!(entity, closure) form (maps to cx.subscribe_in)");
29    };
30}
31
32#[macro_export]
33macro_rules! observe {
34    ($($t:tt)*) => {
35        unreachable!("observe! should only be used inside a #[component] function, and in observe!(Type, |self, window, cx| {}) form");
36    };
37}