diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-21 20:20:45 +0200 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2017-05-22 00:23:02 +0200 |
commit | c03e68041e0f444e18a895058afbdf0d68759517 (patch) | |
tree | 6e31f9726d36e746f43c7856cebff8c861577e31 /frontend/src/sagas/errors.js | |
parent | Clean name in websocket.js (diff) | |
download | seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.tar.gz seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.tar.bz2 seven-wonders-c03e68041e0f444e18a895058afbdf0d68759517.zip |
Update prettier config and reformat
Here's the discussion summary:
- single quote, because that's what I'm used to in the JS world
- trailing comma, to avoid unnecessary git changes
- print-width 120, because 120 still doesn't require to scroll horizontally, and vertical space is precious
Diffstat (limited to 'frontend/src/sagas/errors.js')
-rw-r--r-- | frontend/src/sagas/errors.js | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/frontend/src/sagas/errors.js b/frontend/src/sagas/errors.js index 42994610..41eb6902 100644 --- a/frontend/src/sagas/errors.js +++ b/frontend/src/sagas/errors.js @@ -1,16 +1,12 @@ -import { apply, call, cancelled, put, take } from "redux-saga/effects"; +import { apply, call, cancelled, put, take } from 'redux-saga/effects'; -import { createSubscriptionChannel } from "../utils/websocket"; -import { actions } from "../redux/errors"; +import { createSubscriptionChannel } from '../utils/websocket'; +import { actions } from '../redux/errors'; -import { toastr } from "react-redux-toastr"; +import { toastr } from 'react-redux-toastr'; export default function* errorHandlingSaga({ socket }) { - const errorChannel = yield call( - createSubscriptionChannel, - socket, - "/user/queue/errors" - ); + const errorChannel = yield call(createSubscriptionChannel, socket, '/user/queue/errors'); try { while (true) { const error = yield take(errorChannel); @@ -18,22 +14,22 @@ export default function* errorHandlingSaga({ socket }) { } } finally { if (yield cancelled()) { - console.log("Error management saga cancelled"); + console.log('Error management saga cancelled'); yield apply(errorChannel, errorChannel.close); } } } function* handleOneError(err) { - console.error("Error received on web socket channel", err); + console.error('Error received on web socket channel', err); const msg = buildMsg(err); - yield apply(toastr, toastr.error, [msg, { icon: "error" }]); + yield apply(toastr, toastr.error, [msg, { icon: 'error' }]); yield put(actions.errorReceived(err)); } function buildMsg(err) { if (err.details.length > 0) { - return err.details.map(d => d.message).join("\n"); + return err.details.map(d => d.message).join('\n'); } else { return err.message; } |