Skip to content

Commit daf9102

Browse files
authored
docstrings for backend hooks (#994)
1 parent c86c59d commit daf9102

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/reactpy/backend/hooks.py

+3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212

1313

1414
def use_connection() -> Connection[Any]:
15+
"""Get the current :class:`~reactpy.backend.types.Connection`."""
1516
conn = use_context(ConnectionContext)
1617
if conn is None:
1718
raise RuntimeError("No backend established a connection.") # pragma: no cover
1819
return conn
1920

2021

2122
def use_scope() -> MutableMapping[str, Any]:
23+
"""Get the current :class:`~reactpy.backend.types.Connection`'s scope."""
2224
return use_connection().scope
2325

2426

2527
def use_location() -> Location:
28+
"""Get the current :class:`~reactpy.backend.types.Connection`'s location."""
2629
return use_connection().location

0 commit comments

Comments
 (0)