Skip to content

Commit 77bcc0b

Browse files
committed
fix formatting and type hint
1 parent 72e1974 commit 77bcc0b

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

src/js/packages/@reactpy/client/src/components.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ type ReactPyInputHandler = ((event: TargetedEvent<any>) => void) & {
2525
isHandler?: boolean;
2626
};
2727

28-
type UserInputTarget = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
28+
type UserInputTarget =
29+
| HTMLInputElement
30+
| HTMLSelectElement
31+
| HTMLTextAreaElement;
2932

3033
function trackUserInput(
3134
event: TargetedEvent<any>,

src/js/packages/@reactpy/client/src/vdom.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ export function createAttributes(
206206
function createEventHandler(
207207
client: ReactPyClient,
208208
name: string,
209-
{ target, preventDefault, stopPropagation, debounce }: ReactPyVdomEventHandler,
209+
{
210+
target,
211+
preventDefault,
212+
stopPropagation,
213+
debounce,
214+
}: ReactPyVdomEventHandler,
210215
): [string, () => void] {
211216
const eventHandler = function (...args: any[]) {
212217
const data = Array.from(args).map((value) => {

src/reactpy/executors/asgi/middleware.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
from collections.abc import Iterable
99
from dataclasses import dataclass
1010
from pathlib import Path
11-
from typing import Any, Unpack
11+
from typing import Any, Unpack, cast
1212

1313
import orjson
1414
from asgi_tools import ResponseText, ResponseWebSocket
15+
from asgiref import typing as asgi_types
1516
from asgiref.compatibility import guarantee_single_callable
1617
from servestatic import ServeStaticASGI
1718

@@ -265,7 +266,11 @@ async def __call__(
265266
prefix=self.parent.static_path,
266267
)
267268

268-
await self._static_file_server(scope, receive, send)
269+
await self._static_file_server(
270+
cast(asgi_types.Scope, scope),
271+
cast(asgi_types.ASGIReceiveCallable, receive),
272+
cast(asgi_types.ASGISendCallable, send),
273+
)
269274

270275

271276
@dataclass
@@ -285,7 +290,11 @@ async def __call__(
285290
autorefresh=True,
286291
)
287292

288-
await self._static_file_server(scope, receive, send)
293+
await self._static_file_server(
294+
cast(asgi_types.Scope, scope),
295+
cast(asgi_types.ASGIReceiveCallable, receive),
296+
cast(asgi_types.ASGISendCallable, send),
297+
)
289298

290299

291300
class Error404App:

0 commit comments

Comments
 (0)