re-added doc cfg feature flag but commented out

This commit is contained in:
Maccesch 2023-06-23 22:13:14 +01:00
parent 61ffd9c1b6
commit 915127d749
13 changed files with 16 additions and 2 deletions

View file

@ -13,7 +13,7 @@ repository = "https://github.com/Synphonyte/leptos-use"
homepage = "https://leptos-use.rs"
[dependencies]
leptos = "0.3"
leptos = { version = "0.3", default-features = false }
wasm-bindgen = "0.2"
js-sys = "0.3"
default-struct-builder = "0.2"

View file

@ -1,4 +1,4 @@
//#![feature(doc_cfg)]
// #![feature(doc_cfg)]
//! Collection of essential Leptos utilities inspired by SolidJS USE / VueUse
pub mod core;

View file

@ -1,3 +1,4 @@
// #![doc(cfg(feature = "math"))]
//! Collection of reactive math functions
mod shared;

View file

@ -25,5 +25,6 @@ use_simple_math!(
/// # view! { cx, }
/// # }
/// ```
// #[doc(cfg(feature = "math"))]
abs
);

View file

@ -25,5 +25,6 @@ use_simple_math!(
/// # view! { cx, }
/// # }
/// ```
// #[doc(cfg(feature = "math"))]
ceil
);

View file

@ -25,5 +25,6 @@ use_simple_math!(
/// # view! { cx, }
/// # }
/// ```
// #[doc(cfg(feature = "math"))]
floor
);

View file

@ -26,6 +26,7 @@ use_partial_cmp!(
/// # view! { cx, }
/// # }
/// ```
// #[doc(cfg(feature = "math"))]
use_max,
Ordering::Less
);

View file

@ -26,6 +26,7 @@ use_partial_cmp!(
/// # view! { cx, }
/// # }
/// ```
// #[doc(cfg(feature = "math"))]
use_min,
Ordering::Greater
);

View file

@ -25,5 +25,6 @@ use_simple_math!(
/// # view! { cx, }
/// # }
/// ```
// #[doc(cfg(feature = "math"))]
round
);

View file

@ -49,6 +49,7 @@ macro_rules! use_specific_storage {
pub(crate) use use_specific_storage;
/// Options for [`use_local_storage_with_options`].
// #[doc(cfg(feature = "storage"))]
#[derive(DefaultBuilder)]
pub struct UseSpecificStorageOptions<T> {
/// Listen to changes to this storage key from somewhere else. Defaults to true.

View file

@ -15,6 +15,7 @@ use_specific_storage!(
///
/// * [`use_storage`]
/// * [`use_session_storage`]
// #[doc(cfg(feature = "storage"))]
local
/// [`use_local_storage`]
);

View file

@ -15,6 +15,7 @@ use_specific_storage!(
///
/// * [`use_storage`]
/// * [`use_local_storage`]
// #[doc(cfg(feature = "storage"))]
session
/// [`use_session_storage`]
);

View file

@ -146,6 +146,7 @@ const CUSTOM_STORAGE_EVENT_NAME: &str = "leptos-use-storage";
///
/// * [`use_local_storage`]
/// * [`use_session_storage`]
// #[doc(cfg(feature = "storage"))]
pub fn use_storage<T, D>(
cx: Scope,
key: &str,
@ -160,6 +161,7 @@ where
}
/// 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>(
cx: Scope,
key: &str,
@ -427,6 +429,7 @@ fn get_optional_string(v: &JsValue, key: &str) -> Option<String> {
}
/// Error type for use_storage_with_options
// #[doc(cfg(feature = "storage"))]
pub enum UseStorageError<E = ()> {
NoStorage(JsValue),
StorageAccessError(JsValue),
@ -436,6 +439,7 @@ pub enum UseStorageError<E = ()> {
}
/// Options for [`use_storage_with_options`].
// #[doc(cfg(feature = "storage"))]
#[derive(DefaultBuilder)]
pub struct UseStorageOptions<T> {
/// Type of storage. Can be `Local` (default), `Session` or `Custom(web_sys::Storage)`