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 channelResponseCallback to onJoinChannel action. #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RamanQDO
Copy link
Collaborator

@RamanQDO RamanQDO commented Jan 5, 2022

  • we need to have a possibilities to track onChannelJoin responses (according to hdo_assessor backend architectures)
  • also we need to have an opportunity to trigger some action in case of onChannelJoin failed (for example to show error)

According to existing implementation we only get default JOIN_FAILED response, which is very complex to differentiate from other onChannelJoin events (we could have plenty of them in the same time)

@RamanQDO RamanQDO requested a review from kuzaxak January 5, 2022 22:31
For now getPhoenixChannel method takes "channelResponseEvent" and "channelErrorResponseEvent" string params and dispatch corresponding actions as a callback.
Comment on lines +204 to +206
dispatch(
endPhoenixChannelProgress({ dispatch, channelTopic, loadingStatusKey: channelTopic })
);
Copy link

Choose a reason for hiding this comment

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

Please do not use fixed for formatting commits. Formatting is a separated logic that should be added as a separate commit.

src/middlewares/phoenix/actions/index.js Show resolved Hide resolved
If channel isn't created yet we will never bind an events to it.
Regarding [guideline][1] we should use `payload` as a data key inside actions.

`Should always put their data into a payload field`

[1]: https://redux.js.org/style-guide/style-guide#write-actions-using-the-flux-standard-action-convention
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.

3 participants