We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c86c59d commit daf9102Copy full SHA for daf9102
src/reactpy/backend/hooks.py
@@ -12,15 +12,18 @@
12
13
14
def use_connection() -> Connection[Any]:
15
+ """Get the current :class:`~reactpy.backend.types.Connection`."""
16
conn = use_context(ConnectionContext)
17
if conn is None:
18
raise RuntimeError("No backend established a connection.") # pragma: no cover
19
return conn
20
21
22
def use_scope() -> MutableMapping[str, Any]:
23
+ """Get the current :class:`~reactpy.backend.types.Connection`'s scope."""
24
return use_connection().scope
25
26
27
def use_location() -> Location:
28
+ """Get the current :class:`~reactpy.backend.types.Connection`'s location."""
29
return use_connection().location
0 commit comments