Nul-led / bevy_web_keepalive

Bevy plugins to keep a bevy app running in the browser despite not being visible
MIT License
13 stars 2 forks source link

VisibilityChangeListenerPlugin's `run_main_schedule_on_hide` has no sensible default #5

Closed simbleau closed 5 months ago

simbleau commented 5 months ago
/// The `VisiblityChangeListenerPlugin` plugin registers a listener that fires when bevy's visibility is changed (eg. the user switches to a different browser tab)
///
/// The user may decide to run the `Main` schedule once after the visibility changes to hidden.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct VisiblityChangeListenerPlugin {
    pub run_main_schedule_on_hide: bool,
}

Derive default would mean run_main_schedule_on_hide defaults to false. Is this a desired default?

Probably not?

simbleau commented 5 months ago

Actually, on second thought, this makes sense to me.

Nul-led commented 5 months ago

Yea it is meant as an "optional" feature that the user may choose to activate if necessary