diff --git a/Cargo.toml b/Cargo.toml
index 9ec4f61..de5940a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,14 +14,14 @@ homepage = "https://leptos-use.rs"
[dependencies]
actix-web = { version = "4", optional = true, default-features = false }
-async-trait = "0.1"
+async-trait = { version = "0.1", optional = true }
cfg-if = "1"
-codee = "0.1"
-cookie = { version = "0.18", features = ["percent-encode"] }
+codee = { version = "0.1", optional = true }
+cookie = { version = "0.18", features = ["percent-encode"], optional = true }
default-struct-builder = "0.5"
-futures-util = "0.3"
-gloo-timers = { version = "0.3.0", features = ["futures"] }
-gloo-utils = { version = "0.2.0" }
+futures-util = { version = "0.3", optional = true }
+gloo-timers = { version = "0.3.0", optional = true, features = ["futures"] }
+gloo-utils = { version = "0.2.0", optional = true }
http1 = { version = "1", optional = true, package = "http" }
http0_2 = { version = "0.2", optional = true, package = "http" }
js-sys = "0.3"
@@ -33,101 +33,10 @@ leptos-spin = { version = "0.1", optional = true }
num = { version = "0.4", optional = true }
paste = "1"
thiserror = "1"
-unic-langid = "0.9"
+unic-langid = { version = "0.9", optional = true }
wasm-bindgen = "=0.2.93"
wasm-bindgen-futures = "0.4"
-
-[dependencies.web-sys]
-version = "=0.3.70"
-features = [
- "AddEventListenerOptions",
- "BinaryType",
- "BroadcastChannel",
- "Coordinates",
- "Clipboard",
- "CloseEvent",
- "CssStyleDeclaration",
- "CustomEvent",
- "CustomEventInit",
- "DisplayMediaStreamConstraints",
- "DomRect",
- "DomRectReadOnly",
- "DataTransfer",
- "DragEvent",
- "Element",
- "EventListener",
- "EventListenerOptions",
- "EventSource",
- "EventSourceInit",
- "EventTarget",
- "File",
- "FileList",
- "Geolocation",
- "HtmlDocument",
- "HtmlElement",
- "HtmlLinkElement",
- "HtmlStyleElement",
- "IntersectionObserver",
- "IntersectionObserverInit",
- "IntersectionObserverEntry",
- "Location",
- "MediaDevices",
- "MediaQueryList",
- "MediaStream",
- "MediaStreamConstraints",
- "MediaStreamTrack",
- "MessageEvent",
- "MouseEvent",
- "MutationObserver",
- "MutationObserverInit",
- "MutationRecord",
- "Navigator",
- "NodeList",
- "Notification",
- "NotificationDirection",
- "NotificationOptions",
- "NotificationPermission",
- "Permissions",
- "PermissionState",
- "PermissionStatus",
- "PointerEvent",
- "Position",
- "PositionError",
- "PositionOptions",
- "ReadableStream",
- "ReadableStreamDefaultReader",
- "ReadableStreamGetReaderOptions",
- "ReadableStreamReaderMode",
- "ResizeObserver",
- "ResizeObserverBoxOptions",
- "ResizeObserverEntry",
- "ResizeObserverOptions",
- "ResizeObserverSize",
- "ScrollBehavior",
- "ScrollToOptions",
- "ServiceWorker",
- "ServiceWorkerContainer",
- "ServiceWorkerRegistration",
- "ServiceWorkerState",
- "Storage",
- "StorageEvent",
- "Touch",
- "TouchEvent",
- "TouchList",
- "Url",
- "UrlSearchParams",
- "VisibilityState",
- "WebSocket",
- "WebTransport",
- "WebTransportOptions",
- "WebTransportDatagramDuplexStream",
- "WebTransportBidirectionalStream",
- "Window",
- "WebTransportReceiveStream",
- "WebTransportSendStream",
- "WritableStream",
- "WritableStreamDefaultWriter",
-]
+web-sys = { version = "=0.3.70", optional = true }
[dev-dependencies]
codee = { version = "0.1", features = ["json_serde", "msgpack_serde", "base64", "prost"] }
@@ -138,13 +47,303 @@ serde = { version = "1", features = ["derive"] }
unic-langid = { version = "0.9", features = ["macros"] }
[features]
+default = [
+ "is_err",
+ "is_none",
+ "is_ok",
+ "is_some",
+ "on_click_outside",
+ "signal_debounced",
+ "signal_throttled",
+ "storage",
+ "sync_signal",
+ "use_active_element",
+ "use_breakpoints",
+ "use_broadcast_channel",
+ "use_clipboard",
+ "use_color_mode",
+ "use_cookie",
+ "use_css_var",
+ "use_cycle_list",
+ "use_debounce_fn",
+ "use_device_orientation",
+ "use_device_pixel_ratio",
+ "use_display_media",
+ "use_document",
+ "use_document_visibility",
+ "use_draggable",
+ "use_drop_zone",
+ "use_element_bounding",
+ "use_element_hover",
+ "use_element_size",
+ "use_element_visibility",
+ "use_event_listener",
+ "use_event_source",
+ "use_favicon",
+ "use_geolocation",
+ "use_idle",
+ "use_infinite_scroll",
+ "use_intersection_observer",
+ "use_interval",
+ "use_interval_fn",
+ "use_intl_number_format",
+ "use_locale",
+ "use_locales",
+ "use_media_query",
+ "use_mouse",
+ "use_mouse_in_element",
+ "use_mutation_observer",
+ "use_permission",
+ "use_preferred_contrast",
+ "use_preferred_dark",
+ "use_prefers_reduced_motion",
+ "use_raf_fn",
+ "use_resize_observer",
+ "use_scroll",
+ "use_service_worker",
+ "use_sorted",
+ "use_supported",
+ "use_throttle_fn",
+ "use_timeout_fn",
+ "use_timestamp",
+ "use_to_string",
+ "use_user_media",
+ "use_web_notification",
+ "use_websocket",
+ "use_window",
+ "use_window_focus",
+ "use_window_scroll",
+ "watch_debounced",
+ "watch_pausable",
+ "watch_throttled",
+ "watch_with_options",
+ "whenever"
+]
actix = ["dep:actix-web", "dep:leptos_actix", "dep:http0_2"]
axum = ["dep:leptos_axum", "dep:http1"]
-docs = []
+docs = ["dep:web-sys"]
+element = ["use_document", "use_window", "dep:web-sys", "web-sys/EventTarget"]
+is = ["use_window"]
+is_err = []
+is_none = []
+is_ok = []
+is_some = []
math = ["num"]
+on_click_outside = ["use_event_listener", "is"]
+signal_debounced = ["use_debounce_fn"]
+signal_throttled = ["use_throttle_fn"]
spin = ["dep:leptos-spin", "dep:http1"]
ssr = []
+storage = [
+ "use_event_listener",
+ "use_window",
+ "watch_with_options",
+ "dep:web-sys",
+ "dep:codee",
+ "web-sys/CustomEventInit",
+ "web-sys/Storage"
+]
+sync_signal = []
+use_active_element = ["use_event_listener"]
+use_breakpoints = ["use_media_query"]
+use_broadcast_channel = [
+ "use_event_listener",
+ "use_supported",
+ "dep:codee",
+ "web-sys/BroadcastChannel",
+]
+use_clipboard = [
+ "use_event_listener",
+ "use_permission",
+ "use_supported",
+ "use_timeout_fn",
+ "web-sys/Clipboard",
+]
+use_color_mode = [
+ "use_cookie",
+ "use_cycle_list",
+ "use_preferred_dark",
+ "storage",
+ "sync_signal"
+]
+use_cookie = [
+ "use_broadcast_channel",
+ "watch_pausable",
+ "dep:cookie",
+ "web-sys/HtmlDocument",
+]
+use_css_var = [
+ "use_mutation_observer",
+ "watch_with_options",
+]
+use_cycle_list = []
+use_debounce_fn = []
+use_device_orientation = ["use_event_listener", "use_supported"]
+use_device_pixel_ratio = ["use_event_listener", "web-sys/MediaQueryList"]
+use_display_media = [
+ "use_window",
+ "web-sys/DisplayMediaStreamConstraints",
+ "web-sys/MediaDevices",
+ "web-sys/MediaStream",
+ "web-sys/MediaStreamTrack",
+]
+use_document = [
+ "dep:web-sys",
+ "web-sys/VisibilityState",
+]
+use_document_visibility = ["use_event_listener", "web-sys/VisibilityState"]
+use_draggable = ["use_event_listener", "web-sys/DomRect"]
+use_drop_zone = [
+ "use_event_listener",
+ "web-sys/DataTransfer",
+ "web-sys/File",
+ "web-sys/FileList"
+]
+use_element_bounding = [
+ "use_event_listener",
+ "use_resize_observer",
+ "web-sys/DomRect",
+]
+use_element_hover = ["use_event_listener"]
+use_element_size = [
+ "use_resize_observer",
+ "watch_with_options",
+ "web-sys/ResizeObserverSize",
+]
+use_element_visibility = [
+ "use_intersection_observer",
+ "web-sys/DomRect",
+]
+use_event_listener = [
+ "element",
+ "watch_with_options",
+ "dep:web-sys",
+ "web-sys/EventTarget",
+ "web-sys/EventListenerOptions"
+]
+use_event_source = [
+ "use_event_listener",
+ "web-sys/EventSource",
+ "web-sys/EventSourceInit",
+ "dep:codee",
+]
+use_favicon = []
+use_geolocation = [
+ "use_window",
+ "web-sys/Coordinates",
+ "web-sys/Geolocation",
+ "web-sys/Position",
+ "web-sys/PositionError",
+ "web-sys/PositionOptions",
+]
+use_idle = [
+ "use_event_listener",
+ "use_document",
+ "use_timestamp",
+]
+use_infinite_scroll = [
+ "use_element_visibility",
+ "use_scroll",
+ "dep:gloo-timers",
+ "dep:futures-util",
+]
+use_intersection_observer = [
+ "element",
+ "watch_with_options",
+ "web-sys/IntersectionObserver",
+ "web-sys/IntersectionObserverEntry",
+ "web-sys/IntersectionObserverInit",
+]
+use_interval = ["use_interval_fn"]
+use_interval_fn = []
+use_intl_number_format = []
+use_locale = ["use_locales", "dep:unic-langid"]
+use_locales = ["use_event_listener", "use_window"]
+use_media_query = ["use_event_listener"]
+use_mouse = [
+ "element",
+ "use_event_listener",
+ "use_window",
+ "web-sys/Touch",
+ "web-sys/TouchList",
+]
+use_mouse_in_element = [
+ "use_mouse",
+ "web-sys/DomRect",
+]
+use_mutation_observer = [
+ "element",
+ "use_supported",
+ "web-sys/MutationObserver",
+ "web-sys/MutationObserverInit",
+ "web-sys/MutationRecord",
+]
+use_permission = [
+ "use_event_listener",
+ "web-sys/Permissions",
+ "web-sys/PermissionState",
+ "web-sys/PermissionStatus",
+]
+use_preferred_contrast = ["use_media_query"]
+use_preferred_dark = ["use_media_query"]
+use_prefers_reduced_motion = ["use_media_query"]
+use_raf_fn = []
+use_resize_observer = [
+ "element",
+ "use_supported",
+ "web-sys/DomRectReadOnly",
+ "web-sys/ResizeObserver",
+ "web-sys/ResizeObserverBoxOptions",
+ "web-sys/ResizeObserverEntry",
+ "web-sys/ResizeObserverOptions",
+]
+use_scroll = [
+ "element",
+ "use_event_listener",
+ "use_debounce_fn",
+ "use_throttle_fn",
+ "web-sys/ScrollBehavior",
+ "web-sys/ScrollToOptions",
+]
+use_service_worker = [
+ "use_window",
+ "web-sys/ServiceWorker",
+ "web-sys/ServiceWorkerContainer",
+ "web-sys/ServiceWorkerRegistration"
+]
+use_sorted = []
+use_supported = []
+use_throttle_fn = []
+use_timeout_fn = []
+use_timestamp = ["use_interval_fn", "use_raf_fn"]
+use_to_string = []
+use_user_media = [
+ "use_window",
+ "web-sys/MediaDevices",
+ "web-sys/MediaStream",
+ "web-sys/MediaStreamConstraints",
+ "web-sys/MediaStreamTrack",
+]
+use_web_notification = [
+ "use_supported",
+ "use_window",
+ "use_event_listener",
+ "web-sys/Notification",
+ "web-sys/NotificationOptions",
+ "web-sys/NotificationPermission",
+ "web-sys/NotificationDirection",
+ "web-sys/VisibilityState"
+]
+use_websocket = ["dep:codee"]
+use_window = ["use_document", "dep:web-sys", "web-sys/Navigator", "web-sys/MediaQueryList"]
+use_window_focus = ["use_event_listener"]
+use_window_scroll = ["use_event_listener", "use_window"]
wasm_ssr = []
+watch_debounced = ["watch_with_options"]
+watch_pausable = ["watch_with_options"]
+watch_throttled = ["watch_with_options"]
+watch_with_options = []
+whenever = []
[package.metadata.docs.rs]
features = ["math", "docs", "ssr"]
diff --git a/examples/on_click_outside/Cargo.toml b/examples/on_click_outside/Cargo.toml
index 3313bf8..c6d6279 100644
--- a/examples/on_click_outside/Cargo.toml
+++ b/examples/on_click_outside/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["on_click_outside", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/signal_debounced/Cargo.toml b/examples/signal_debounced/Cargo.toml
index 6f85a28..9411da3 100644
--- a/examples/signal_debounced/Cargo.toml
+++ b/examples/signal_debounced/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["signal_debounced", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/signal_throttled/Cargo.toml b/examples/signal_throttled/Cargo.toml
index 73b2b91..2a14d8a 100644
--- a/examples/signal_throttled/Cargo.toml
+++ b/examples/signal_throttled/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["signal_throttled", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/ssr/Cargo.toml b/examples/ssr/Cargo.toml
index 533ce90..33e9575 100644
--- a/examples/ssr/Cargo.toml
+++ b/examples/ssr/Cargo.toml
@@ -16,7 +16,6 @@ leptos = { version = "0.6", features = ["nightly"] }
leptos_axum = { version = "0.6", optional = true }
leptos_meta = { version = "0.6", features = ["nightly"] }
leptos_router = { version = "0.6", features = ["nightly"] }
-leptos-use = { path = "../.." }
log = "0.4"
simple_logger = "4"
tokio = { version = "1", features = ["full"], optional = true }
@@ -28,6 +27,20 @@ thiserror = "1.0.38"
tracing = { version = "0.1.37", optional = true }
http = "1"
+[dependencies.leptos-use]
+path = "../.."
+features = [
+ "use_cookie",
+ "use_color_mode",
+ "use_debounce_fn",
+ "use_event_listener",
+ "use_interval",
+ "use_intl_number_format",
+ "use_locales",
+ "use_timestamp",
+ "storage"
+]
+
[features]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
ssr = [
diff --git a/examples/sync_signal/Cargo.toml b/examples/sync_signal/Cargo.toml
index 0eae2b1..c072a2b 100644
--- a/examples/sync_signal/Cargo.toml
+++ b/examples/sync_signal/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["sync_signal", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_active_element/Cargo.toml b/examples/use_active_element/Cargo.toml
index c19c400..e5c31a5 100644
--- a/examples/use_active_element/Cargo.toml
+++ b/examples/use_active_element/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_active_element", "docs"] }
web-sys = { version = "0.3", features = ["HtmlElement", "DomStringMap"] }
[dev-dependencies]
diff --git a/examples/use_breakpoints/Cargo.toml b/examples/use_breakpoints/Cargo.toml
index 22b894b..b022945 100644
--- a/examples/use_breakpoints/Cargo.toml
+++ b/examples/use_breakpoints/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_breakpoints", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_broadcast_channel/Cargo.toml b/examples/use_broadcast_channel/Cargo.toml
index a7bf756..3cfcd3f 100644
--- a/examples/use_broadcast_channel/Cargo.toml
+++ b/examples/use_broadcast_channel/Cargo.toml
@@ -9,7 +9,7 @@ codee = "0.1"
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_broadcast_channel", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_clipboard/Cargo.toml b/examples/use_clipboard/Cargo.toml
index d85ad83..43cba10 100644
--- a/examples/use_clipboard/Cargo.toml
+++ b/examples/use_clipboard/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_clipboard", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_color_mode/Cargo.toml b/examples/use_color_mode/Cargo.toml
index ead2ef6..26874f0 100644
--- a/examples/use_color_mode/Cargo.toml
+++ b/examples/use_color_mode/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_color_mode", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_cookie/Cargo.toml b/examples/use_cookie/Cargo.toml
index c645550..2974155 100644
--- a/examples/use_cookie/Cargo.toml
+++ b/examples/use_cookie/Cargo.toml
@@ -9,7 +9,7 @@ codee = "0.1"
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_cookie", "docs"] }
rand = "0.8"
getrandom = { version = "0.2", features = ["js"] }
web-sys = "0.3"
diff --git a/examples/use_css_var/Cargo.toml b/examples/use_css_var/Cargo.toml
index 267c40e..97d6fa6 100644
--- a/examples/use_css_var/Cargo.toml
+++ b/examples/use_css_var/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_css_var", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_cycle_list/Cargo.toml b/examples/use_cycle_list/Cargo.toml
index c59b61c..77f6c25 100644
--- a/examples/use_cycle_list/Cargo.toml
+++ b/examples/use_cycle_list/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_cycle_list", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_debounce_fn/Cargo.toml b/examples/use_debounce_fn/Cargo.toml
index d5f4621..c3f7b9e 100644
--- a/examples/use_debounce_fn/Cargo.toml
+++ b/examples/use_debounce_fn/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_debounce_fn", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_device_orientation/Cargo.toml b/examples/use_device_orientation/Cargo.toml
index 9a4c64a..5fec238 100644
--- a/examples/use_device_orientation/Cargo.toml
+++ b/examples/use_device_orientation/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_device_orientation", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_device_pixel_ratio/Cargo.toml b/examples/use_device_pixel_ratio/Cargo.toml
index 5874c65..98efdde 100644
--- a/examples/use_device_pixel_ratio/Cargo.toml
+++ b/examples/use_device_pixel_ratio/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_device_pixel_ratio", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_display_media/Cargo.toml b/examples/use_display_media/Cargo.toml
index c7ffe6a..f5f4b79 100644
--- a/examples/use_display_media/Cargo.toml
+++ b/examples/use_display_media/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_display_media", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_document_visibility/Cargo.toml b/examples/use_document_visibility/Cargo.toml
index cb9b8f1..8d5b019 100644
--- a/examples/use_document_visibility/Cargo.toml
+++ b/examples/use_document_visibility/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_document_visibility", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_draggable/Cargo.toml b/examples/use_draggable/Cargo.toml
index e2e9a61..8427afb 100644
--- a/examples/use_draggable/Cargo.toml
+++ b/examples/use_draggable/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_draggable", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_drop_zone/Cargo.toml b/examples/use_drop_zone/Cargo.toml
index 115dc9d..aa05fca 100644
--- a/examples/use_drop_zone/Cargo.toml
+++ b/examples/use_drop_zone/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_drop_zone", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_element_bounding/Cargo.toml b/examples/use_element_bounding/Cargo.toml
index 7620bcd..8ef72c3 100644
--- a/examples/use_element_bounding/Cargo.toml
+++ b/examples/use_element_bounding/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_element_bounding", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_element_hover/Cargo.toml b/examples/use_element_hover/Cargo.toml
index 9d90e62..9be576c 100644
--- a/examples/use_element_hover/Cargo.toml
+++ b/examples/use_element_hover/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_element_hover", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_element_size/Cargo.toml b/examples/use_element_size/Cargo.toml
index daf02f0..4e71f62 100644
--- a/examples/use_element_size/Cargo.toml
+++ b/examples/use_element_size/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_element_size", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_element_visibility/Cargo.toml b/examples/use_element_visibility/Cargo.toml
index 50ba543..3506775 100644
--- a/examples/use_element_visibility/Cargo.toml
+++ b/examples/use_element_visibility/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_element_visibility", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_event_listener/Cargo.toml b/examples/use_event_listener/Cargo.toml
index 653bb76..d0e75c1 100644
--- a/examples/use_event_listener/Cargo.toml
+++ b/examples/use_event_listener/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../.." }
+leptos-use = { path = "../..", features = ["use_event_listener"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_favicon/Cargo.toml b/examples/use_favicon/Cargo.toml
index 260413a..38d4f05 100644
--- a/examples/use_favicon/Cargo.toml
+++ b/examples/use_favicon/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_favicon", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_geolocation/Cargo.toml b/examples/use_geolocation/Cargo.toml
index bb7c93e..4ded1d2 100644
--- a/examples/use_geolocation/Cargo.toml
+++ b/examples/use_geolocation/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_geolocation", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_idle/Cargo.toml b/examples/use_idle/Cargo.toml
index 1b412b4..0e8d92a 100644
--- a/examples/use_idle/Cargo.toml
+++ b/examples/use_idle/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_idle", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_infinite_scroll/Cargo.toml b/examples/use_infinite_scroll/Cargo.toml
index e55811a..52cafcb 100644
--- a/examples/use_infinite_scroll/Cargo.toml
+++ b/examples/use_infinite_scroll/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_infinite_scroll", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_intersection_observer/Cargo.toml b/examples/use_intersection_observer/Cargo.toml
index b401615..b8c5d1a 100644
--- a/examples/use_intersection_observer/Cargo.toml
+++ b/examples/use_intersection_observer/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_intersection_observer", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_interval/Cargo.toml b/examples/use_interval/Cargo.toml
index a49f0cd..cd02ec5 100644
--- a/examples/use_interval/Cargo.toml
+++ b/examples/use_interval/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_interval", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_interval_fn/Cargo.toml b/examples/use_interval_fn/Cargo.toml
index 86bc8b2..96de322 100644
--- a/examples/use_interval_fn/Cargo.toml
+++ b/examples/use_interval_fn/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs", "math"] }
+leptos-use = { path = "../..", features = ["use_interval_fn", "docs", "math"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_intl_number_format/Cargo.toml b/examples/use_intl_number_format/Cargo.toml
index 7eadd70..5ed97da 100644
--- a/examples/use_intl_number_format/Cargo.toml
+++ b/examples/use_intl_number_format/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_intl_number_format", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_locale/Cargo.toml b/examples/use_locale/Cargo.toml
index 1a2555a..1c592fe 100644
--- a/examples/use_locale/Cargo.toml
+++ b/examples/use_locale/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_locale", "docs"] }
unic-langid = { version = "0.9", features = ["macros"] }
web-sys = "0.3"
diff --git a/examples/use_locales/Cargo.toml b/examples/use_locales/Cargo.toml
index 05b5bc9..c98524c 100644
--- a/examples/use_locales/Cargo.toml
+++ b/examples/use_locales/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_locales", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_media_query/Cargo.toml b/examples/use_media_query/Cargo.toml
index 345aa87..a57d7fe 100644
--- a/examples/use_media_query/Cargo.toml
+++ b/examples/use_media_query/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_media_query", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_mouse/Cargo.toml b/examples/use_mouse/Cargo.toml
index 1c91a04..cb2dea3 100644
--- a/examples/use_mouse/Cargo.toml
+++ b/examples/use_mouse/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_mouse", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_mouse_in_element/Cargo.toml b/examples/use_mouse_in_element/Cargo.toml
index ac23964..2823591 100644
--- a/examples/use_mouse_in_element/Cargo.toml
+++ b/examples/use_mouse_in_element/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_mouse_in_element", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_mutation_observer/Cargo.toml b/examples/use_mutation_observer/Cargo.toml
index fcf12fd..c85533a 100644
--- a/examples/use_mutation_observer/Cargo.toml
+++ b/examples/use_mutation_observer/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_mutation_observer", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_permission/Cargo.toml b/examples/use_permission/Cargo.toml
index 17f2388..f03e633 100644
--- a/examples/use_permission/Cargo.toml
+++ b/examples/use_permission/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_permission", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_prefers_reduced_motion/Cargo.toml b/examples/use_prefers_reduced_motion/Cargo.toml
index 4b0d55a..3cdeb8d 100644
--- a/examples/use_prefers_reduced_motion/Cargo.toml
+++ b/examples/use_prefers_reduced_motion/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_prefers_reduced_motion", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_raf_fn/Cargo.toml b/examples/use_raf_fn/Cargo.toml
index 48b8cd9..e9c4c57 100644
--- a/examples/use_raf_fn/Cargo.toml
+++ b/examples/use_raf_fn/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_raf_fn", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_resize_observer/Cargo.toml b/examples/use_resize_observer/Cargo.toml
index 0ce7f4c..8ba4ed2 100644
--- a/examples/use_resize_observer/Cargo.toml
+++ b/examples/use_resize_observer/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_resize_observer", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_scroll/Cargo.toml b/examples/use_scroll/Cargo.toml
index ccb133a..25874cd 100644
--- a/examples/use_scroll/Cargo.toml
+++ b/examples/use_scroll/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_scroll", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_service_worker/Cargo.toml b/examples/use_service_worker/Cargo.toml
index 8e3b8c7..f074dd0 100644
--- a/examples/use_service_worker/Cargo.toml
+++ b/examples/use_service_worker/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_service_worker", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_sorted/Cargo.toml b/examples/use_sorted/Cargo.toml
index 05462ac..8ff335f 100644
--- a/examples/use_sorted/Cargo.toml
+++ b/examples/use_sorted/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_sorted", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_storage/Cargo.toml b/examples/use_storage/Cargo.toml
index 5174789..b8b2285 100644
--- a/examples/use_storage/Cargo.toml
+++ b/examples/use_storage/Cargo.toml
@@ -8,7 +8,7 @@ codee = { version = "0.1", features = ["json_serde"] }
console_error_panic_hook = "0.1"
console_log = "1"
leptos = { version = "0.6", features = ["nightly", "csr"] }
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["storage", "docs"] }
log = "0.4"
serde = "1.0.163"
web-sys = "0.3"
diff --git a/examples/use_throttle_fn/Cargo.toml b/examples/use_throttle_fn/Cargo.toml
index 04d6006..d39fc8d 100644
--- a/examples/use_throttle_fn/Cargo.toml
+++ b/examples/use_throttle_fn/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_throttle_fn", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_timeout_fn/Cargo.toml b/examples/use_timeout_fn/Cargo.toml
index 9b0cfa4..608afac 100644
--- a/examples/use_timeout_fn/Cargo.toml
+++ b/examples/use_timeout_fn/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_timeout_fn", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_timestamp/Cargo.toml b/examples/use_timestamp/Cargo.toml
index a065eb4..5e0a16f 100644
--- a/examples/use_timestamp/Cargo.toml
+++ b/examples/use_timestamp/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_timestamp", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_user_media/Cargo.toml b/examples/use_user_media/Cargo.toml
index ffd38b8..170c4af 100644
--- a/examples/use_user_media/Cargo.toml
+++ b/examples/use_user_media/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_user_media", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_web_notification/Cargo.toml b/examples/use_web_notification/Cargo.toml
index 216f31e..f499927 100644
--- a/examples/use_web_notification/Cargo.toml
+++ b/examples/use_web_notification/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_web_notification", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_websocket/Cargo.toml b/examples/use_websocket/Cargo.toml
index 2eb5095..26ed9a6 100644
--- a/examples/use_websocket/Cargo.toml
+++ b/examples/use_websocket/Cargo.toml
@@ -9,7 +9,7 @@ codee = { version = "0.1", features = ["msgpack_serde"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_websocket", "docs"] }
serde = { version = "1", features = ["derive"] }
web-sys = "0.3"
diff --git a/examples/use_webtransport/Cargo.toml b/examples/use_webtransport/Cargo.toml
index 5291647..680dc93 100644
--- a/examples/use_webtransport/Cargo.toml
+++ b/examples/use_webtransport/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_web_notification", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_window_focus/Cargo.toml b/examples/use_window_focus/Cargo.toml
index d157e75..ff9224a 100644
--- a/examples/use_window_focus/Cargo.toml
+++ b/examples/use_window_focus/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_window_focus", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/use_window_scroll/Cargo.toml b/examples/use_window_scroll/Cargo.toml
index d8a1c48..43092e2 100644
--- a/examples/use_window_scroll/Cargo.toml
+++ b/examples/use_window_scroll/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["use_window_scroll", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/watch_debounced/Cargo.toml b/examples/watch_debounced/Cargo.toml
index 8af3c77..b7d1872 100644
--- a/examples/watch_debounced/Cargo.toml
+++ b/examples/watch_debounced/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["watch_debounced", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/watch_pausable/Cargo.toml b/examples/watch_pausable/Cargo.toml
index a14897d..548f01a 100644
--- a/examples/watch_pausable/Cargo.toml
+++ b/examples/watch_pausable/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["watch_pausable", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/examples/watch_throttled/Cargo.toml b/examples/watch_throttled/Cargo.toml
index e711c4f..d69a67a 100644
--- a/examples/watch_throttled/Cargo.toml
+++ b/examples/watch_throttled/Cargo.toml
@@ -8,7 +8,7 @@ leptos = { version = "0.6", features = ["nightly", "csr"] }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
-leptos-use = { path = "../..", features = ["docs"] }
+leptos-use = { path = "../..", features = ["watch_throttled", "docs"] }
web-sys = "0.3"
[dev-dependencies]
diff --git a/src/core/mod.rs b/src/core/mod.rs
index 3fe5ca3..0b51baa 100644
--- a/src/core/mod.rs
+++ b/src/core/mod.rs
@@ -1,26 +1,32 @@
mod connection_ready_state;
mod datetime;
mod direction;
+#[cfg(feature = "element")]
mod element_maybe_signal;
+#[cfg(feature = "element")]
mod elements_maybe_signal;
mod maybe_rw_signal;
mod pointer_type;
mod position;
+mod reconnect_limit;
mod size;
mod ssr_safe_method;
-mod storage;
+#[cfg(feature = "use_color_mode")]
pub(crate) mod url;
mod use_rw_signal;
pub use connection_ready_state::*;
pub(crate) use datetime::*;
pub use direction::*;
+#[cfg(feature = "element")]
pub use element_maybe_signal::*;
+#[cfg(feature = "element")]
pub use elements_maybe_signal::*;
pub use maybe_rw_signal::*;
pub use pointer_type::*;
pub use position::*;
+pub use reconnect_limit::*;
pub use size::*;
+#[allow(unused_imports)]
pub(crate) use ssr_safe_method::*;
-pub use storage::*;
pub use use_rw_signal::*;
diff --git a/src/core/reconnect_limit.rs b/src/core/reconnect_limit.rs
new file mode 100644
index 0000000..5d28b2c
--- /dev/null
+++ b/src/core/reconnect_limit.rs
@@ -0,0 +1,20 @@
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
+pub enum ReconnectLimit {
+ Infinite,
+ Limited(u64),
+}
+
+impl Default for ReconnectLimit {
+ fn default() -> Self {
+ ReconnectLimit::Limited(3)
+ }
+}
+
+impl ReconnectLimit {
+ pub fn is_exceeded_by(self, times: u64) -> bool {
+ match self {
+ ReconnectLimit::Infinite => false,
+ ReconnectLimit::Limited(limit) => times >= limit,
+ }
+ }
+}
diff --git a/src/core/ssr_safe_method.rs b/src/core/ssr_safe_method.rs
index 9ffa513..da46452 100644
--- a/src/core/ssr_safe_method.rs
+++ b/src/core/ssr_safe_method.rs
@@ -1,3 +1,5 @@
+#![allow(unused_macros, unused_imports)]
+
macro_rules! impl_ssr_safe_method {
(
$(#[$attr:meta])*
diff --git a/src/core/storage.rs b/src/core/storage.rs
deleted file mode 100644
index 8390217..0000000
--- a/src/core/storage.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-use leptos::window;
-use wasm_bindgen::JsValue;
-
-/// Local or session storage or a custom store that is a `web_sys::Storage`.
-#[derive(Default)]
-pub enum StorageType {
- #[default]
- Local,
- Session,
- Custom(web_sys::Storage),
-}
-
-impl StorageType {
- pub fn into_storage(self) -> Result