✏️Editing socket client config

This commit is contained in:
2021-11-01 01:10:29 -07:00
parent 464e7da826
commit 195d9431c4

View File

@@ -3,17 +3,22 @@ import { createStore, applyMiddleware, compose } from "redux";
import { createBrowserHistory } from "history";
import thunk from "redux-thunk";
import createRootReducer from "../reducers";
import socketIO from "socket.io-client";
import { io } from "socket.io-client";
import socketIoMiddleware from "redux-socket.io-middleware";
// import { SOCKET_BASE_URI } from "../constants/endpoints";
const io = socketIO(`http://rook:3001`);
// const socketConnection = io(`http://rook:3001`);
export const history = createBrowserHistory();
const configureStore = (initialState) => {
const store = createStore(
createRootReducer(history),
initialState,
compose(
applyMiddleware(socketIoMiddleware(io), thunk, routerMiddleware(history)),
applyMiddleware(
// socketIoMiddleware(socketConnection),
thunk,
routerMiddleware(history),
),
// window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
),
);