Update docs to specify that values are synced across multiple use_storage calls on the same page and other tabs / windows

This commit is contained in:
Joshua McQuistan 2023-10-29 15:44:20 +00:00
parent f899f560e5
commit 208451f0c2
2 changed files with 2 additions and 4 deletions

View file

@ -71,7 +71,7 @@ fn Demo() -> impl IntoView {
<pre>{move || format!("{:#?}", state2.get())}</pre>
<Note>
"The values are persistent. When you reload the page the values will be the same."
"The values are persistent. When you reload the page or open a second window, the values will be the same."
</Note>
}
}

View file

@ -123,12 +123,10 @@ where
///
/// ## Usage
///
/// Pass a [`StorageType`] to determine the kind of key-value browser storage to use. The specified key is where data is stored. All values are stored as UTF-16 strings which is then encoded and decoded via the given [`Codec`].Finally, see [`UseStorageOptions`] to see how behaviour can be further customised.
/// Pass a [`StorageType`] to determine the kind of key-value browser storage to use. The specified key is where data is stored. All values are stored as UTF-16 strings which is then encoded and decoded via the given [`Codec`]. This value is synced with other calls using the same key on the smae page and across tabs for local storage. See [`UseStorageOptions`] to see how behaviour can be further customised.
///
/// Returns a triplet `(read_signal, write_signal, delete_from_storage_fn)`.
///
/// Signals work as expected and can be used to read and write to storage. The `delete_from_storage_fn` can be called to delete the item from storage. Once deleted the signals will revert back to the default value.
///
/// ## Example
///
/// ```