Closed crumblingstatue closed 2 years ago
This allows callers of update to initialize variables computed in the closure.
An example use case is the following pattern:
let event_flags = app.tray_handle.update(|tray: &mut AppTray| { app.write_tray_info(&mut tray.app_state.tray_info); tray.app_state.paused = app.paused_or_stopped(); tray.event_flags.take() }); if event_flags.quit_clicked { break; } if event_flags.activated { win_visible ^= true; rw.set_visible(win_visible); } ...
:+1:
This allows callers of update to initialize variables computed in the closure.
An example use case is the following pattern: