mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-02-02 10:54:15 -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"
|
||||
|
||||
[dependencies]
|
||||
leptos = "0.3"
|
||||
leptos = { version = "0.3", default-features = false }
|
||||
wasm-bindgen = "0.2"
|
||||
js-sys = "0.3"
|
||||
default-struct-builder = "0.2"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//#![feature(doc_cfg)]
|
||||
// #![feature(doc_cfg)]
|
||||
//! Collection of essential Leptos utilities inspired by SolidJS USE / VueUse
|
||||
|
||||
pub mod core;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// #![doc(cfg(feature = "math"))]
|
||||
//! Collection of reactive math functions
|
||||
|
||||
mod shared;
|
||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
|||
/// # view! { cx, }
|
||||
/// # }
|
||||
/// ```
|
||||
// #[doc(cfg(feature = "math"))]
|
||||
abs
|
||||
);
|
||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
|||
/// # view! { cx, }
|
||||
/// # }
|
||||
/// ```
|
||||
// #[doc(cfg(feature = "math"))]
|
||||
ceil
|
||||
);
|
||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
|||
/// # view! { cx, }
|
||||
/// # }
|
||||
/// ```
|
||||
// #[doc(cfg(feature = "math"))]
|
||||
floor
|
||||
);
|
||||
|
|
|
@ -26,6 +26,7 @@ use_partial_cmp!(
|
|||
/// # view! { cx, }
|
||||
/// # }
|
||||
/// ```
|
||||
// #[doc(cfg(feature = "math"))]
|
||||
use_max,
|
||||
Ordering::Less
|
||||
);
|
||||
|
|
|
@ -26,6 +26,7 @@ use_partial_cmp!(
|
|||
/// # view! { cx, }
|
||||
/// # }
|
||||
/// ```
|
||||
// #[doc(cfg(feature = "math"))]
|
||||
use_min,
|
||||
Ordering::Greater
|
||||
);
|
||||
|
|
|
@ -25,5 +25,6 @@ use_simple_math!(
|
|||
/// # view! { cx, }
|
||||
/// # }
|
||||
/// ```
|
||||
// #[doc(cfg(feature = "math"))]
|
||||
round
|
||||
);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -15,6 +15,7 @@ use_specific_storage!(
|
|||
///
|
||||
/// * [`use_storage`]
|
||||
/// * [`use_session_storage`]
|
||||
// #[doc(cfg(feature = "storage"))]
|
||||
local
|
||||
/// [`use_local_storage`]
|
||||
);
|
||||
|
|
|
@ -15,6 +15,7 @@ use_specific_storage!(
|
|||
///
|
||||
/// * [`use_storage`]
|
||||
/// * [`use_local_storage`]
|
||||
// #[doc(cfg(feature = "storage"))]
|
||||
session
|
||||
/// [`use_session_storage`]
|
||||
);
|
||||
|
|
|
@ -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)`
|
||||
|
|
Loading…
Add table
Reference in a new issue