Expose fetch_id helper in window module

This commit is contained in:
Héctor Ramón Jiménez 2023-02-17 13:47:46 +01:00
parent 9f75f01ddb
commit 2c2421ae5d
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -95,3 +95,12 @@ pub fn change_always_on_top<Message>(on_top: bool) -> Command<Message> {
on_top,
)))
}
/// Fetches an identifier unique to the window.
pub fn fetch_id<Message>(
f: impl FnOnce(u64) -> Message + 'static,
) -> Command<Message> {
Command::single(command::Action::Window(window::Action::FetchId(Box::new(
f,
))))
}