Skip to content

Commit 7b5a8d6

Browse files
committed
deployment updates to make cleaner code
1 parent b097264 commit 7b5a8d6

File tree

1 file changed

+0
-66
lines changed

1 file changed

+0
-66
lines changed

app/src/index.js

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ import Tutorial from './tutorial/Tutorial.tsx';
1919
import TutorialPage from './tutorial/TutorialPage.tsx';
2020
import ProjectDashboard from './Dashboard/ProjectContainer.tsx';
2121

22-
// for websockets
23-
// import debounce from 'lodash/debounce';
24-
2522
const client = new ApolloClient({
2623
uri: 'https://reactype-caret.herokuapp.com/graphql',
2724
cache: new InMemoryCache()
@@ -40,69 +37,6 @@ const PrivateRoute = ({ component: Component, ...rest }) => (
4037
/>
4138
);
4239

43-
// // websocket front end starts here
44-
// import { io } from 'socket.io-client';
45-
// import { toggleDarkMode } from './redux/reducers/slice/darkModeSlice';
46-
47-
// import { allCooperativeState } from './redux/reducers/slice/appStateSlice.ts';
48-
// import { codePreviewCooperative } from './redux/reducers/slice/codePreviewSlice';
49-
// import { allContextCooperative } from './redux/reducers/slice/contextReducer';
50-
// import { cooperativeStyle } from './redux/reducers/slice/styleSlice';
51-
// import config from '../../config';
52-
// const { API_BASE_URL } = config;
53-
54-
// const socket = io(API_BASE_URL, {
55-
// transports: ['websocket']
56-
// });
57-
58-
// socket.on('connect', () => {
59-
// console.log(`You connected with id: ${socket.id}`);
60-
// });
61-
62-
// console.log(store.getState());
63-
// let previousState = store.getState();
64-
65-
// // sending info to backend whenever the redux store changes
66-
// const handleStoreChange = debounce(() => {
67-
// const newState = store.getState();
68-
// if (store.getState().roomCodeSlice.roomCode !== '') {
69-
// socket.emit('room-code', store.getState().roomCodeSlice.roomCode);
70-
// }
71-
// if (newState !== previousState) {
72-
// console.log('before sending to server: ', newState);
73-
// socket.emit(
74-
// 'custom-event',
75-
// 'sent from front-end',
76-
// JSON.stringify(newState),
77-
// store.getState().roomCodeSlice.roomCode
78-
// );
79-
// previousState = newState;
80-
// }
81-
// }, 100);
82-
83-
// // receiving the message from the back end
84-
// socket.on('receive message', (event) => {
85-
// // console.log('message from server: ', event);
86-
// let currentStore = JSON.stringify(store.getState());
87-
// if (currentStore !== event) {
88-
// currentStore = JSON.parse(currentStore);
89-
// event = JSON.parse(event);
90-
// console.log('stores do not match');
91-
// if (currentStore.darkMode.isDarkMode !== event.darkMode.isDarkMode) {
92-
// store.dispatch(toggleDarkMode());
93-
// } else if (currentStore.appState !== event.appState) {
94-
// store.dispatch(allCooperativeState(event.appState));
95-
// } else if (currentStore.codePreviewSlice !== event.codePreviewCooperative) {
96-
// store.dispatch(codePreviewCooperative(event.codePreviewCooperative));
97-
// } else if (currentStore.styleSlice !== event.styleSlice) {
98-
// store.dispatch(cooperativeStyle(event.styleSlice));
99-
// }
100-
// }
101-
// console.log('updated user Store from another user: ', store.getState());
102-
// });
103-
104-
// store.subscribe(handleStoreChange);
105-
10640
ReactDOM.render(
10741
<ApolloProvider client={client}>
10842
<Provider store={store}>

0 commit comments

Comments
 (0)