Struct leptos_use::WatchOptions
source · pub struct WatchOptions { /* private fields */ }
Expand description
Options for watch_with_options
Implementations§
source§impl WatchOptions
impl WatchOptions
sourcepub fn immediate(self, value: bool) -> Self
pub fn immediate(self, value: bool) -> Self
If immediate
is true, the callback
will run immediately.
If it’s false, the
callbackwill run only after the first change is detected of any signal that is accessed in
deps. Defaults to
false`.
sourcepub fn filter(self, value: FilterOptions) -> Self
pub fn filter(self, value: FilterOptions) -> Self
Allows to debounce or throttle the callback. Defaults to no filter.
source§impl WatchOptions
impl WatchOptions
sourcepub fn debounce(self, ms: impl Into<MaybeSignal<f64>>) -> Self
pub fn debounce(self, ms: impl Into<MaybeSignal<f64>>) -> Self
Debounce
the watch callback
by ms
milliseconds.
sourcepub fn debounce_with_options(
self,
ms: impl Into<MaybeSignal<f64>>,
options: DebounceOptions,
) -> Self
pub fn debounce_with_options( self, ms: impl Into<MaybeSignal<f64>>, options: DebounceOptions, ) -> Self
Debounce
the watch callback
by ms
milliseconds with additional options.
sourcepub fn throttle(self, ms: impl Into<MaybeSignal<f64>>) -> Self
pub fn throttle(self, ms: impl Into<MaybeSignal<f64>>) -> Self
Throttle
the watch callback
by ms
milliseconds.
sourcepub fn throttle_with_options(
self,
ms: impl Into<MaybeSignal<f64>>,
options: ThrottleOptions,
) -> Self
pub fn throttle_with_options( self, ms: impl Into<MaybeSignal<f64>>, options: ThrottleOptions, ) -> Self
Throttle
the watch callback
by ms
milliseconds with additional options.
Trait Implementations§
source§impl Default for WatchOptions
impl Default for WatchOptions
source§fn default() -> WatchOptions
fn default() -> WatchOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WatchOptions
impl !RefUnwindSafe for WatchOptions
impl !Send for WatchOptions
impl !Sync for WatchOptions
impl Unpin for WatchOptions
impl !UnwindSafe for WatchOptions
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more