Skip to content

Commit ee9ed2f

Browse files
BiosBoyactions-user
authored andcommitted
Apply formatting changes
1 parent 825463c commit ee9ed2f

File tree

18 files changed

+132
-132
lines changed

18 files changed

+132
-132
lines changed

src/__tests__/mocks/body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
22
imageToShow: 1,
3-
switchImage: imgNumber => imgNumber
4-
};
3+
switchImage: (imgNumber) => imgNumber
4+
}

src/components/Footer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { memo } from 'react';
2-
import styles from '../styles/index.scss';
1+
import React, { memo } from 'react'
2+
import styles from '../styles/index.scss'
33

44
const Footer = memo(() => {
5-
return <div className={styles.appFooter}>App Footer</div>;
6-
});
5+
return <div className={styles.appFooter}>App Footer</div>
6+
})
77

8-
Footer.displayName = 'Footer';
8+
Footer.displayName = 'Footer'
99

10-
export default Footer;
10+
export default Footer

src/components/Header.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { memo } from 'react';
2-
import styles from '../styles/index.scss';
1+
import React, { memo } from 'react'
2+
import styles from '../styles/index.scss'
33

44
const Header = memo(() => {
5-
return <div className={styles.appHeader}>App Headers</div>;
6-
});
5+
return <div className={styles.appHeader}>App Headers</div>
6+
})
77

8-
Header.displayName = 'Header';
8+
Header.displayName = 'Header'
99

10-
export default Header;
10+
export default Header

src/components/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Header from './Header';
2-
import Body from './Body';
3-
import Footer from './Footer';
1+
import Header from './Header'
2+
import Body from './Body'
3+
import Footer from './Footer'
44

5-
export { Header, Body, Footer };
5+
export { Header, Body, Footer }

src/constants/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const SWITCH_IMAGE = 'SWITCH_IMAGE';
1+
export const SWITCH_IMAGE = 'SWITCH_IMAGE'
22
// consts for Saga asyc actions, probably you do not need this below
3-
export const SOME_SAGA = 'SOME_SAGA';
4-
export const SOME_ASYNC_ACTION = 'SOME_ASYNC_ACTION';
3+
export const SOME_SAGA = 'SOME_SAGA'
4+
export const SOME_ASYNC_ACTION = 'SOME_ASYNC_ACTION'

src/controller/actions/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { SWITCH_IMAGE, SOME_ASYNC_ACTION } from '../../constants';
1+
import { SWITCH_IMAGE, SOME_ASYNC_ACTION } from '../../constants'
22

33
const switchImage = (imageID) => ({
44
type: SWITCH_IMAGE,
55
imageID
6-
});
6+
})
77

88
const someAsyncAction = (payload) => ({
99
type: SOME_ASYNC_ACTION,
1010
payload
11-
});
11+
})
1212

13-
export { switchImage, someAsyncAction };
13+
export { switchImage, someAsyncAction }

src/controller/reducers/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { LOCATION_CHANGE } from 'connected-react-router';
2-
import { SWITCH_IMAGE, SOME_ASYNC_ACTION } from '../../constants';
3-
import initialState from '../../store/initialState';
1+
import { LOCATION_CHANGE } from 'connected-react-router'
2+
import { SWITCH_IMAGE, SOME_ASYNC_ACTION } from '../../constants'
3+
import initialState from '../../store/initialState'
44

55
// ------------------------------------
66
// Action Handlers
@@ -18,15 +18,15 @@ const ACTION_HANDLERS = {
1818
...state,
1919
locationChange: action.payload.location.pathname
2020
})
21-
};
21+
}
2222

2323
// ------------------------------------
2424
// Reducer
2525
// ------------------------------------
2626
const reducer = (state = initialState, action) => {
27-
const handler = ACTION_HANDLERS[action.type];
27+
const handler = ACTION_HANDLERS[action.type]
2828

29-
return handler ? handler(state, action) : state;
30-
};
29+
return handler ? handler(state, action) : state
30+
}
3131

32-
export default reducer;
32+
export default reducer

src/controller/saga/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { takeLatest } from 'redux-saga/effects';
2-
import saga from './saga';
3-
import { SOME_SAGA } from '../../constants';
1+
import { takeLatest } from 'redux-saga/effects'
2+
import saga from './saga'
3+
import { SOME_SAGA } from '../../constants'
44

55
export default function* watchSagas() {
6-
yield takeLatest(SOME_SAGA, saga);
6+
yield takeLatest(SOME_SAGA, saga)
77
}

src/controller/saga/saga.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { put } from 'redux-saga/effects';
2-
import { someAsyncAction } from '../actions';
1+
import { put } from 'redux-saga/effects'
2+
import { someAsyncAction } from '../actions'
33

44
export function* saga() {
55
try {
6-
const payload = yield fetch('https://www.github.com');
6+
const payload = yield fetch('https://www.github.com')
77

88
// throw an error if no payload received
99
if (!payload) {
10-
throw new Error('Error in payload!');
10+
throw new Error('Error in payload!')
1111
}
1212

1313
// some payload from the responce received
14-
yield put(someAsyncAction(payload));
14+
yield put(someAsyncAction(payload))
1515
} catch (error) {
16-
throw new Error('Some error in sagas occured!');
16+
throw new Error('Some error in sagas occured!')
1717
}
1818
}
1919

20-
export default saga;
20+
export default saga

src/index.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import RedBox from 'redbox-react';
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import RedBox from 'redbox-react'
44

5-
import store from './store/store';
6-
import history from './store/history';
7-
import AppProvider from './provider/index';
5+
import store from './store/store'
6+
import history from './store/history'
7+
import AppProvider from './provider/index'
88

9-
const ENTRY_POINT = document.querySelector('#react-app-root');
9+
const ENTRY_POINT = document.querySelector('#react-app-root')
1010

1111
// creating starting endpoint for app.
1212
const render = () => {
13-
ReactDOM.render(<AppProvider store={store} history={history} />, ENTRY_POINT);
14-
};
13+
ReactDOM.render(<AppProvider store={store} history={history} />, ENTRY_POINT)
14+
}
1515

1616
// this will help us understand where the problem is located once app will fall.
1717
const renderError = (error) => {
18-
ReactDOM.render(<RedBox error={error} />, ENTRY_POINT);
19-
};
18+
ReactDOM.render(<RedBox error={error} />, ENTRY_POINT)
19+
}
2020

2121
// register serviceWorkers if available
2222
// we don't need them for now
@@ -45,14 +45,14 @@ if (__DEV__) {
4545

4646
// Wrap render in try/catch
4747
try {
48-
render();
48+
render()
4949
} catch (error) {
50-
console.error(error);
51-
renderError(error);
50+
console.error(error)
51+
renderError(error)
5252
}
5353
} else {
5454
// ========================================================
5555
// PRODUCTION GO!
5656
// ========================================================
57-
render();
57+
render()
5858
}

0 commit comments

Comments
 (0)