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! init_with_context {
13    ($($t:tt)*) => {
14        unreachable!("use_context! should only be used inside a #[component] function, and in ident: type = expr or ident: type form");
15    };
16}
17
18#[macro_export]
19macro_rules! subscribe {
20    ($($t:tt)*) => {
21        unreachable!("subscribe! should only be used inside a #[component] function, and in subscribe!(ident, closure) form");
22    };
23}
24
25#[macro_export]
26macro_rules! observe {
27    ($($t:tt)*) => {
28        unreachable!("observe! should only be used inside a #[component] function, and in observe!(Type, |self, window, cx| {}) form");
29    };
30}