Tidying connections; Move into indexed connections
This commit is contained in:
@ -89,7 +89,7 @@ const PusherMiddleware = (function(){
|
||||
);
|
||||
|
||||
socket.onopen = () => {
|
||||
store.dispatch({ type: 'PUSHER_CONNECTED', connection: connection });
|
||||
store.dispatch({ type: 'PUSHER_CONNECTED', connection_id: connection.connection_id });
|
||||
store.dispatch({ type: 'PUSHER_SET_USERNAME', username: connection.username });
|
||||
};
|
||||
|
||||
|
||||
@ -7,11 +7,8 @@ export default function reducer(pusher = {}, action){
|
||||
return Object.assign({}, pusher, { connected: false, connecting: true });
|
||||
|
||||
case 'PUSHER_CONNECTED':
|
||||
return Object.assign({}, pusher, {
|
||||
connected: true,
|
||||
connecting: false,
|
||||
connection_id: action.connection.connection_id,
|
||||
username: action.connection.username
|
||||
return Object.assign({}, pusher, {
|
||||
connection_id: action.connection_id
|
||||
});
|
||||
|
||||
case 'PUSHER_DISCONNECTED':
|
||||
|
||||
Reference in New Issue
Block a user