Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add hooks to socket.io events to handle connected state in the middleware #7

Open
Vandise opened this issue Mar 1, 2019 · 0 comments
Assignees
Milestone

Comments

@Vandise
Copy link
Owner

Vandise commented Mar 1, 2019

Add hooks to socket.io events to handle connected state in the middleware.

The function in question is:

export function registerStateEvents(id, events, redux) {
  const socket = exports.getSocket(id);
  events.map((evt) => {
    let eventAction = evt.dispatch;
    socket.on(evt.action.toString(), eventAction(
      socket,
      redux.store,
      redux.next,
      redux.action
    ));
  });
};

Where on events such as disconnect and reconnect need to toggle the SOCKET_INITIALIZED status.

The current state of the socket isn't reflected in the middleware

@Vandise Vandise added this to the v2.0.0 milestone Mar 1, 2019
@Vandise Vandise self-assigned this Mar 1, 2019
@Vandise Vandise modified the milestones: v2.0.0, v2.0.1 Mar 2, 2019
@Vandise Vandise modified the milestones: v2.0.1, 2.1.0 Mar 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant