Revert window::close producing a window::Id
Instead, subscribing to `window::close_events` is preferable; since most use cases will want to react to the user closing a window as well.
This commit is contained in:
parent
22fc5ce0ea
commit
8b45d620d0
4 changed files with 7 additions and 12 deletions
|
|
@ -24,7 +24,7 @@ pub enum Action {
|
|||
Open(Id, Settings, oneshot::Sender<Id>),
|
||||
|
||||
/// Close the window and exits the application.
|
||||
Close(Id, oneshot::Sender<Id>),
|
||||
Close(Id),
|
||||
|
||||
/// Gets the [`Id`] of the oldest window.
|
||||
GetOldest(oneshot::Sender<Option<Id>>),
|
||||
|
|
@ -230,8 +230,8 @@ pub fn open(settings: Settings) -> (Id, Task<Id>) {
|
|||
}
|
||||
|
||||
/// Closes the window with `id`.
|
||||
pub fn close(id: Id) -> Task<Id> {
|
||||
task::oneshot(|channel| crate::Action::Window(Action::Close(id, channel)))
|
||||
pub fn close<T>(id: Id) -> Task<T> {
|
||||
task::effect(crate::Action::Window(Action::Close(id)))
|
||||
}
|
||||
|
||||
/// Gets the window [`Id`] of the oldest window.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue