Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | /** * @module Client * Client Application */ import * as React from 'react'; import { render } from 'react-dom'; import io from 'socket.io-client'; import { App } from './App'; import { Provider } from './provider'; import { startReceiver } from './socket/receiver'; import { action, actionBatch, update } from './socket/sender'; import { createStore } from './store'; import { Actions } from './actions'; const rootElement = document.getElementById('root'); export const socket = io('/'); // Pas la meilleure solution pour envoyer à Socket.IO, mais fera l'affaire pour le moment const socketMiddleware = _store => next => reduxAction => { if (reduxAction.type === Actions.SOCKET_ACTION) { action(reduxAction.payload); } if (reduxAction.type === Actions.SOCKET_ACTIONS) { actionBatch(reduxAction.payload); } if (reduxAction.type === Actions.SOCKET_UPDATE) { update(reduxAction.payload); } next(reduxAction); } export const frontendStore = createStore(socketMiddleware); if (rootElement) { render( ( <Provider store={frontendStore}> <App /> </Provider> ), rootElement, ); } startReceiver(frontendStore); |