-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New API to define triggers #1820
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the new API. This is great!
@@ -48,14 +49,15 @@ class Checkbox(ChakraComponent): | |||
# The spacing between the checkbox and its label text (0.5rem) | |||
spacing: Var[str] | |||
|
|||
def get_controlled_triggers(self) -> Dict[str, Var]: | |||
def get_event_triggers(self) -> dict[str, Union[Var, Any]]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could define a type Callable[Var, List[Var]]
for the lambda type and use that instead of Any
. Also, when would Var
be the dictionary value type, wouldn't it always be a Callable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put Any because my previous definition using LambdaTypes was causing a lot of pyright errors.
Also the Union[Var, ...] is for backward compatibility until removal of deprecated features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-approve
All Submissions:
Type of change
Changes To Core Features:
Description
Change the API for defining the signature expected for any event triggers (uncontrolled or controlled):
Deprecate the following :
get_controlled_triggers
,EVENT_ARG
,get_triggers
,EventChain
Also remove the unused and not working component
CopyToClipboard