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

How do you receive messages? #2

Open
designbyadrian opened this issue Aug 21, 2017 · 3 comments
Open

How do you receive messages? #2

designbyadrian opened this issue Aug 21, 2017 · 3 comments

Comments

@designbyadrian
Copy link

Having all messages being dispatched as actions would be good.

Having connected and disconnected actions as well would be ideal.

@patrickmuhi
Copy link

@designbyadrian did you manage to implement it?

@sergiodxa
Copy link
Contributor

The middleware is used to emit actions, to receive messages you need to save the connection to a constant before passing it to the middleware and then use socket.on('action', store.dispatch) (or anything you want to do with the action).

I recommend you to remove the action.meta.socket key on your server to avoid the middleware emitting them again.

@patrickmuhi
Copy link

@sergiodxa wubba lubba dub dub 🙏💯

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

3 participants