Skip to content

Conversation

kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented Sep 12, 2021

Closes #786

@mxschmitt
Copy link
Member

mxschmitt commented Sep 14, 2021

nice work!

Screen.Recording.2021-09-14.at.12.45.43.mov

@mxschmitt
Copy link
Member

Can we have a fallback to the value which we had before? Otherwise we might break existing users which had the event name as a string. e.g. at the end of the on overloads in the Page.


    @typing.overload
    def on(
        self,
        event: str,
        f: typing.Callable[..., typing.Union[typing.Awaitable[None], None]],
    ) -> None:
        return super().on(event=event, f=f)

@kumaraditya303
Copy link
Contributor Author

Can we have a fallback to the value which we had before? Otherwise we might break existing users which had the event name as a string. e.g. at the end of the on overloads in the Page.


    @typing.overload
    def on(
        self,
        event: str,
        f: typing.Callable[..., typing.Union[typing.Awaitable[None], None]],
    ) -> None:
        return super().on(event=event, f=f)

This is non-breaking change moreover it is typing only change hence there is no runtime change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Generate Event based overloads for event listeners
2 participants