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

refactor: Convert TripPlannerResultsSection to a function component #2252

Merged

Conversation

joshlarson
Copy link
Contributor

Follow up to this comment, which suggested biasing much more strongly towards function components, and this PR, which consolidated the TripPlannerResultsSection state into a single variable.

User-facing-wise, this should be a pure refactor, so no visible changes.

No ticket.

@joshlarson joshlarson requested a review from a team as a code owner December 9, 2024 14:34
@joshlarson joshlarson enabled auto-merge (squash) December 9, 2024 14:34
/>
</div>
"""
end

@impl true
def handle_event("set_itinerary_group_index", %{"index" => index_str}, socket) do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of the reasons I originally made everything live components was because of these event names; it felt a bit odd to have the event names spread around the way they are - the handler is here, but the thing that generates the event is tucked away in trip_planner_results_section (or for the set_itinerary_index event, tucked away in itinerary_detail).

Is that okay? Do we want to pass the event names around as attrs? Some other solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Realistically, I could see the answer to this being a follow-up, rather than trying to "fix" it in this PR, but I am interested in what our overarching vision for this type of question is.

@joshlarson joshlarson merged commit 3772344 into main Dec 9, 2024
20 checks passed
@joshlarson joshlarson deleted the jdl/function-component-for-trip-planner-results-section branch December 9, 2024 16:29
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