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 new App event "page", emitted when a new Page instance is created #640

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

ericyhwang
Copy link
Contributor

While the App's "ready" and "load" events provide the app's current Page instance when emitted, those events only fire a single time per App instance.

There are a couple scenarios where an App instance can create a new Page instance after initial load:

  • A full client-side route change inside the app (non-transitional route)
  • A code-initiated client page refresh with app.history.refresh()

That means an app can't rely on the "ready" and "load" events to do custom initialization on Page instances.

To allow such customizations, this adds a new "page" event, emitted each time an app creates new Page instances.

Note - this new event is emitted both during server-side rendering, as well as during client-side initialization and page changes.

@ericyhwang ericyhwang requested a review from craigbeck June 5, 2024 23:21
Copy link
Contributor

@craigbeck craigbeck left a comment

Choose a reason for hiding this comment

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

👍 looks good

@ericyhwang ericyhwang merged commit aeaf4d5 into master Jun 5, 2024
5 checks passed
@ericyhwang ericyhwang deleted the app-page-event branch June 5, 2024 23:37
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.

2 participants