mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-02-08 21:33:09 -05:00
re-added doc cfg feature flag but commented out
This commit is contained in:
parent
61ffd9c1b6
commit
915127d749
13 changed files with 16 additions and 2 deletions
|
@ -13,7 +13,7 @@ repository = "https://github.com/Synphonyte/leptos-use"
|
||||||
homepage = "https://leptos-use.rs"
|
homepage = "https://leptos-use.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
leptos = "0.3"
|
leptos = { version = "0.3", default-features = false }
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
js-sys = "0.3"
|
js-sys = "0.3"
|
||||||
default-struct-builder = "0.2"
|
default-struct-builder = "0.2"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// #![doc(cfg(feature = "math"))]
|
||||||
//! Collection of reactive math functions
|
//! Collection of reactive math functions
|
||||||
|
|
||||||
mod shared;
|
mod shared;
|
||||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
||||||
/// # view! { cx, }
|
/// # view! { cx, }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
// #[doc(cfg(feature = "math"))]
|
||||||
abs
|
abs
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
||||||
/// # view! { cx, }
|
/// # view! { cx, }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
// #[doc(cfg(feature = "math"))]
|
||||||
ceil
|
ceil
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
||||||
/// # view! { cx, }
|
/// # view! { cx, }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
// #[doc(cfg(feature = "math"))]
|
||||||
floor
|
floor
|
||||||
);
|
);
|
||||||
|
|
|
@ -26,6 +26,7 @@ use_partial_cmp!(
|
||||||
/// # view! { cx, }
|
/// # view! { cx, }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
// #[doc(cfg(feature = "math"))]
|
||||||
use_max,
|
use_max,
|
||||||
Ordering::Less
|
Ordering::Less
|
||||||
);
|
);
|
||||||
|
|
|
@ -26,6 +26,7 @@ use_partial_cmp!(
|
||||||
/// # view! { cx, }
|
/// # view! { cx, }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
// #[doc(cfg(feature = "math"))]
|
||||||
use_min,
|
use_min,
|
||||||
Ordering::Greater
|
Ordering::Greater
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
||||||
/// # view! { cx, }
|
/// # view! { cx, }
|
||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
|
// #[doc(cfg(feature = "math"))]
|
||||||
round
|
round
|
||||||
);
|
);
|
||||||
|
|
|
@ -49,6 +49,7 @@ macro_rules! use_specific_storage {
|
||||||
pub(crate) use use_specific_storage;
|
pub(crate) use use_specific_storage;
|
||||||
|
|
||||||
/// Options for [`use_local_storage_with_options`].
|
/// Options for [`use_local_storage_with_options`].
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
#[derive(DefaultBuilder)]
|
#[derive(DefaultBuilder)]
|
||||||
pub struct UseSpecificStorageOptions<T> {
|
pub struct UseSpecificStorageOptions<T> {
|
||||||
/// Listen to changes to this storage key from somewhere else. Defaults to true.
|
/// Listen to changes to this storage key from somewhere else. Defaults to true.
|
||||||
|
|
|
@ -15,6 +15,7 @@ use_specific_storage!(
|
||||||
///
|
///
|
||||||
/// * [`use_storage`]
|
/// * [`use_storage`]
|
||||||
/// * [`use_session_storage`]
|
/// * [`use_session_storage`]
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
local
|
local
|
||||||
/// [`use_local_storage`]
|
/// [`use_local_storage`]
|
||||||
);
|
);
|
||||||
|
|
|
@ -15,6 +15,7 @@ use_specific_storage!(
|
||||||
///
|
///
|
||||||
/// * [`use_storage`]
|
/// * [`use_storage`]
|
||||||
/// * [`use_local_storage`]
|
/// * [`use_local_storage`]
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
session
|
session
|
||||||
/// [`use_session_storage`]
|
/// [`use_session_storage`]
|
||||||
);
|
);
|
||||||
|
|
|
@ -146,6 +146,7 @@ const CUSTOM_STORAGE_EVENT_NAME: &str = "leptos-use-storage";
|
||||||
///
|
///
|
||||||
/// * [`use_local_storage`]
|
/// * [`use_local_storage`]
|
||||||
/// * [`use_session_storage`]
|
/// * [`use_session_storage`]
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
pub fn use_storage<T, D>(
|
pub fn use_storage<T, D>(
|
||||||
cx: Scope,
|
cx: Scope,
|
||||||
key: &str,
|
key: &str,
|
||||||
|
@ -160,6 +161,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Version of [`use_storage`] that accepts [`UseStorageOptions`]. See [`use_storage`] for how to use.
|
/// Version of [`use_storage`] that accepts [`UseStorageOptions`]. See [`use_storage`] for how to use.
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
pub fn use_storage_with_options<T, D>(
|
pub fn use_storage_with_options<T, D>(
|
||||||
cx: Scope,
|
cx: Scope,
|
||||||
key: &str,
|
key: &str,
|
||||||
|
@ -427,6 +429,7 @@ fn get_optional_string(v: &JsValue, key: &str) -> Option<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Error type for use_storage_with_options
|
/// Error type for use_storage_with_options
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
pub enum UseStorageError<E = ()> {
|
pub enum UseStorageError<E = ()> {
|
||||||
NoStorage(JsValue),
|
NoStorage(JsValue),
|
||||||
StorageAccessError(JsValue),
|
StorageAccessError(JsValue),
|
||||||
|
@ -436,6 +439,7 @@ pub enum UseStorageError<E = ()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Options for [`use_storage_with_options`].
|
/// Options for [`use_storage_with_options`].
|
||||||
|
// #[doc(cfg(feature = "storage"))]
|
||||||
#[derive(DefaultBuilder)]
|
#[derive(DefaultBuilder)]
|
||||||
pub struct UseStorageOptions<T> {
|
pub struct UseStorageOptions<T> {
|
||||||
/// Type of storage. Can be `Local` (default), `Session` or `Custom(web_sys::Storage)`
|
/// Type of storage. Can be `Local` (default), `Session` or `Custom(web_sys::Storage)`
|
||||||
|
|
Loading…
Add table
Reference in a new issue