pub struct UseBoolean {
pub value: Signal<bool>,
}Expand description
A reactive boolean toggle with a caller-chosen initial value.
The existing Toggle type always starts as false, which is the
right default for a switch but the wrong one for a dialog that opens
already expanded. This type is the same toggle with the initial
value chosen by the caller.
The current value is exposed as a Signal<bool> accessed through
get_value(). Any html! body that reads toggle.get_value().get()
inside its render closure re-renders when the value changes.
Fields§
§value: Signal<bool>The current value signal.
Defaults to Signal::create(false) via #[new(skip)]; the hook
overwrites it with the requested initial value.
Implementations§
Source§impl UseBoolean
Inherent implementation of UseBoolean.
impl UseBoolean
Inherent implementation of UseBoolean.
Source§impl UseBoolean
impl UseBoolean
Source§impl UseBoolean
impl UseBoolean
Trait Implementations§
Source§impl Clone for UseBoolean
impl Clone for UseBoolean
Source§impl Debug for UseBoolean
impl Debug for UseBoolean
Auto Trait Implementations§
impl Freeze for UseBoolean
impl RefUnwindSafe for UseBoolean
impl Send for UseBoolean
impl Sync for UseBoolean
impl Unpin for UseBoolean
impl UnsafeUnpin for UseBoolean
impl UnwindSafe for UseBoolean
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more