Improved prelude

This commit is contained in:
2026-01-31 00:15:40 +01:00
parent ab9548920c
commit 85342d641f
6 changed files with 9 additions and 10 deletions
+6 -1
View File
@@ -14,8 +14,9 @@ pub mod prelude {
pub use crate::frontend::*;
pub use crate::render::*;
pub use crate::state::*;
pub use crate::View;
pub use crate::{sleep, Error, Result, View, ViewWrapper};
pub use osui_macros::{component, rsx};
pub use std::sync::{Arc, Mutex};
}
pub type View = Arc<dyn Fn(&mut DrawContext) + Send + Sync>;
@@ -32,3 +33,7 @@ impl From<std::sync::PoisonError<std::sync::MutexGuard<'_, bool>>> for Error {
Error::PoisonError
}
}
pub fn sleep(delay_ms: u64) {
std::thread::sleep(std::time::Duration::from_millis(delay_ms));
}