Skip to content

Commit b986fe1

Browse files
authored
make is_server and is_browser public (#4204)
1 parent e2e28ef commit b986fe1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

leptos_dom/src/helpers.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,8 @@ impl WindowListenerHandle {
593593
}
594594
}
595595

596-
fn is_server() -> bool {
596+
/// Returns `true` if the current environment is a server.
597+
pub fn is_server() -> bool {
597598
#[cfg(feature = "hydration")]
598599
{
599600
Owner::current_shared_context()
@@ -605,3 +606,8 @@ fn is_server() -> bool {
605606
false
606607
}
607608
}
609+
610+
/// Returns `true` if the current environment is a browser.
611+
pub fn is_browser() -> bool {
612+
!is_server()
613+
}

0 commit comments

Comments
 (0)