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

[Feature Request] Provide action$ steam like dependencies while using createEpicMiddleware #758

Open
parav01d opened this issue Dec 28, 2021 · 0 comments

Comments

@parav01d
Copy link

Connect the action$ steam over sockets with the backend

Proof of Concept

In one of my applications, I tried to send the Redux action$ stream directly to the backend via a socket. The responses from the backend are in turn written directly back into the stream as an action. To trigger the dispatch function of redux I wrote an epic for success and failure actions which merge the actions directly to the action$ steam again. ( to trigger dispatch ).

Problem

To minimalize the boilerplate I wanted to reduce the amount of code using an backend$ steam combined with an action$ steam as input for react-observable. So I created a websocket connection to the backend with rxjs/webSocket and wanted to use it as an action$ steam. But there is no way to change the action$ steam. I changed the createEpicMiddleware options in my project to provide an action$ steam property like dependencies on creation.

Improvement

Please provide action$ property like dependencies while creating createEpicMiddleware to make it more flexible while working with steams.

Example

While spending more or less time with my family on Christmas I created this proof of concept which shows the problem.

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

No branches or pull requests

1 participant