Skip to content
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

add onload event handler #337

Merged
merged 1 commit into from Jan 25, 2023
Merged

add onload event handler #337

merged 1 commit into from Jan 25, 2023

Conversation

Lendemor
Copy link
Collaborator

  • Can now pass an event handler to the add_page() method, as the on_load keyword argument.

closes #142

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job

@@ -27,4 +27,13 @@ def preprocess(self, app: App, state: State, event: Event) -> Optional[Delta]:
An optional state to return.
"""
if event.name == utils.get_hydrate_event(state):
route = event.router_data.get("pathname", "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice using the router_data

@picklelo picklelo merged commit 52aaf36 into reflex-dev:main Jan 25, 2023
@Lendemor Lendemor deleted the onload_event branch January 31, 2023 00:40
ACucos1 pushed a commit to ACucos1/rd-pynecone that referenced this pull request Feb 28, 2023
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.

Add on_load event for pages
2 participants