Skip to content

Commit 9b94afc

Browse files
committed
self review
1 parent 3831515 commit 9b94afc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/reactpy/asgi/standalone.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,23 @@ def route(
9090
self,
9191
path: str,
9292
type: Literal["http"] = "http",
93-
) -> Callable[[AsgiHttpApp | str], None]: ...
93+
) -> Callable[[AsgiHttpApp | str], AsgiApp]: ...
9494

9595
@overload
9696
def route(
9797
self,
9898
path: str,
9999
type: Literal["websocket"],
100-
) -> Callable[[AsgiWebsocketApp | str], None]: ...
100+
) -> Callable[[AsgiWebsocketApp | str], AsgiApp]: ...
101101

102102
def route(
103103
self,
104104
path: str,
105105
type: Literal["http", "websocket"] = "http",
106-
) -> Callable[[AsgiHttpApp | str], None] | Callable[[AsgiWebsocketApp | str], None]:
106+
) -> (
107+
Callable[[AsgiHttpApp | str], AsgiApp]
108+
| Callable[[AsgiWebsocketApp | str], AsgiApp]
109+
):
107110
"""Interface that allows user to define their own HTTP/Websocket routes
108111
within the current ReactPy application.
109112
@@ -114,7 +117,7 @@ def route(
114117

115118
def decorator(
116119
app: AsgiApp | str,
117-
) -> None:
120+
) -> AsgiApp:
118121
re_path = path
119122
if not re_path.startswith("^"):
120123
re_path = f"^{re_path}"
@@ -127,6 +130,8 @@ def decorator(
127130
elif type == "websocket":
128131
self.extra_ws_routes[re_path] = cast(AsgiWebsocketApp, asgi_app)
129132

133+
return asgi_app
134+
130135
return decorator
131136

132137
def lifespan(self, app: AsgiLifespanApp | str) -> None:

0 commit comments

Comments
 (0)