Skip to main content

use_toggle

Function use_toggle 

Source
pub fn use_toggle(
    initial_value: impl Into<MaybeRwSignal<bool>>,
) -> UseToggleReturn<impl Fn() + Clone + Send + Sync + 'static>
Expand description

A boolean switcher with utility functions.

§Demo

Link to Demo

§Usage

let UseToggleReturn { toggle, value, set_value } = use_toggle(true);

§See also

  • [fn@crate::use_cycle_list]