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

Watch channel events #2692

Merged
merged 10 commits into from
Jun 26, 2024
Merged

Watch channel events #2692

merged 10 commits into from
Jun 26, 2024

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Jun 13, 2024

Description

Refactor how we watch websocket events using a eventChannel.
This is the correct way to listen external events.

Big benefits:

  • Remove the direct redux store dependency
  • Refactor the usage of events, using correct actions (that are created using the javascript internal event names). So we don't have direct attachment to websocket event names and redux event names

How was this tested?

Test added. I have created a mocked version of the phoenix sockets. It looks minimalist enough

@arbulu89 arbulu89 force-pushed the watch-channel-events branch 3 times, most recently from 8ded7ae to 60af319 Compare June 13, 2024 12:46
@arbulu89 arbulu89 requested a review from EMaksy June 13, 2024 13:00
@arbulu89 arbulu89 marked this pull request as ready for review June 13, 2024 13:00
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM, this is great!

For the future we might consider splitting channels.js into multiple files but on the other hand I just hope we don't have many more events to manage 😛

@arbulu89 arbulu89 force-pushed the watch-channel-events branch from 60af319 to 6f8730a Compare June 25, 2024 07:17
@arbulu89 arbulu89 force-pushed the watch-channel-events branch from 6f8730a to efc1c7f Compare June 25, 2024 15:00
@arbulu89 arbulu89 merged commit f4fc1a6 into main Jun 26, 2024
26 checks passed
@arbulu89 arbulu89 deleted the watch-channel-events branch June 26, 2024 08:29
Copy link
Member

@EMaksy EMaksy left a comment

Choose a reason for hiding this comment

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

Nice!

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

Successfully merging this pull request may close these issues.

3 participants