summaryrefslogtreecommitdiff
path: root/frontend/src/sagas.js
blob: df49b0997f842979402ee069c75434bafce79ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { router } from 'redux-saga-router'
import { call } from 'redux-saga/effects'

import { makeSagaRoutes } from './routes'
import createWsConnection from './utils/createWebSocketConnection'

export default function *rootSaga(history) {
  let wsConnection
  try {
    wsConnection = yield call(createWsConnection)
  } catch (error) {
    console.error('Could not connect to socket')
    return
  }

  yield* router(history, makeSagaRoutes(wsConnection))
}
bgstack15