mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-03-13 17:09:50 -04:00
Document fields on UseStorageOptions
This commit is contained in:
parent
93556a3f8f
commit
94841e4bb5
1 changed files with 5 additions and 0 deletions
|
@ -38,10 +38,15 @@ pub trait Codec<T>: Clone + 'static {
|
||||||
|
|
||||||
/// Options for use with [`use_local_storage_with_options`], [`use_session_storage_with_options`] and [`use_storage_with_options`].
|
/// Options for use with [`use_local_storage_with_options`], [`use_session_storage_with_options`] and [`use_storage_with_options`].
|
||||||
pub struct UseStorageOptions<T: 'static, C: Codec<T>> {
|
pub struct UseStorageOptions<T: 'static, C: Codec<T>> {
|
||||||
|
// Translates to and from UTF-16 strings
|
||||||
codec: C,
|
codec: C,
|
||||||
|
// Callback for when an error occurs
|
||||||
on_error: Rc<dyn Fn(UseStorageError<C::Error>)>,
|
on_error: Rc<dyn Fn(UseStorageError<C::Error>)>,
|
||||||
|
// Whether to continuously listen to changes from browser storage
|
||||||
listen_to_storage_changes: bool,
|
listen_to_storage_changes: bool,
|
||||||
|
// Initial value to use when the storage key is not set
|
||||||
initial_value: MaybeRwSignal<T>,
|
initial_value: MaybeRwSignal<T>,
|
||||||
|
// Debounce or throttle the writing to storage whenever the value changes
|
||||||
filter: FilterOptions,
|
filter: FilterOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue