Skip to content

Commit

Permalink
fix: Fixing typing for python 3.8 in client_state.
Browse files Browse the repository at this point in the history
  • Loading branch information
abulvenz committed May 17, 2024
1 parent 635e701 commit a758e33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions reflex/experimental/client_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dataclasses
import sys
from typing import Any, Callable, Optional, Type
from typing import Any, Callable, Optional, Type, Union

from reflex import constants
from reflex.event import EventChain, EventHandler, EventSpec, call_script
Expand Down Expand Up @@ -171,7 +171,9 @@ def set(self) -> Var:
)
)

def retrieve(self, callback: EventHandler | Callable | None = None) -> EventSpec:
def retrieve(
self, callback: Union[EventHandler, Callable, None] = None
) -> EventSpec:
"""Pass the value of the client state variable to a backend EventHandler.
The event handler must `yield` or `return` the EventSpec to trigger the event.
Expand Down

0 comments on commit a758e33

Please sign in to comment.