mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Format with updated Prettier 0.19
This commit is contained in:
parent
cf5018b77a
commit
ad3ceca9e8
6 changed files with 32 additions and 29 deletions
|
|
@ -77,8 +77,7 @@ function fetchInitialState(requestUrl) {
|
|||
|
||||
// pathname may match with several routes (if they don't have exact=true)
|
||||
// We filter all the components form matched routes that have `loadData`
|
||||
const initialFetches = _
|
||||
.chain(matchedRoutes)
|
||||
const initialFetches = _.chain(matchedRoutes)
|
||||
.filter(r => r.loadData)
|
||||
.map(r => sagaEffects.fork(r.loadData, sdk))
|
||||
.value();
|
||||
|
|
@ -92,8 +91,9 @@ function fetchInitialState(requestUrl) {
|
|||
if (initialFetches.length > 0) {
|
||||
const fetchPromise = new Promise((resolve, reject) => {
|
||||
const store = configureStore({});
|
||||
store.runSaga(fetchInitialData).done
|
||||
.then(() => {
|
||||
store
|
||||
.runSaga(fetchInitialData)
|
||||
.done.then(() => {
|
||||
resolve(store.getState());
|
||||
})
|
||||
.catch(e => {
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ const info = {
|
|||
{ id: 4, title: 'img4', imageUrl: 'http://placehold.it/750x470' },
|
||||
{ id: 5, title: 'img5', imageUrl: 'http://placehold.it/750x470' },
|
||||
],
|
||||
description: (
|
||||
`
|
||||
description: `
|
||||
<p>
|
||||
Organic Music Production in a Sustainable, Ethical and Professional Studio.
|
||||
</p>
|
||||
|
|
@ -24,20 +23,17 @@ const info = {
|
|||
Banyan Studios is a comfortable, conscious, inspiring and creative retreat for musicians trying to convey their message through state of the art Audio & Video.
|
||||
</p>
|
||||
<a href="https://vimeo.com/168106603" alt="video">https://vimeo.com/168106603</a>
|
||||
`
|
||||
),
|
||||
`,
|
||||
reviews: [
|
||||
{
|
||||
id: 1,
|
||||
reviewer: { avatar: 'http://placehold.it/44x44', name: 'Vesa L.', date: 'January 2017' },
|
||||
rating: 4,
|
||||
review: (
|
||||
`
|
||||
review: `
|
||||
Great studio in the New York for music professionals. Everything you need
|
||||
can be found from here and John was helpful with the right settings -
|
||||
we even got some tips for our songs! :)
|
||||
`
|
||||
),
|
||||
`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -80,16 +80,19 @@ export const loadListings = {
|
|||
# { id: 123, type: 'user', attributes: { name: "John" }},
|
||||
```
|
||||
*/
|
||||
const lookupMap = included => included.reduce((memo, resource) => {
|
||||
const { type, id } = resource;
|
||||
const lookupMap = included => included.reduce(
|
||||
(memo, resource) => {
|
||||
const { type, id } = resource;
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
memo[type] = memo[type] || {};
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
memo[type][id.uuid] = resource;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
memo[type] = memo[type] || {};
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
memo[type][id.uuid] = resource;
|
||||
|
||||
return memo;
|
||||
}, {});
|
||||
return memo;
|
||||
},
|
||||
{},
|
||||
);
|
||||
|
||||
// Format the data as ListingCard component expects it and
|
||||
// add some fake data
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
import * as BookingInfo from './components/BookingInfo/BookingInfo.example';
|
||||
|
||||
import * as ChangeAccountPasswordForm from './containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.example';
|
||||
import * as ChangeAccountPasswordForm
|
||||
from './containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.example';
|
||||
import * as ChangePasswordForm from './containers/ChangePasswordForm/ChangePasswordForm.example';
|
||||
import * as HeroSearchForm from './containers/HeroSearchForm/HeroSearchForm.example';
|
||||
import * as LoginForm from './containers/LoginForm/LoginForm.example';
|
||||
import * as PasswordForgottenForm from './containers/PasswordForgottenForm/PasswordForgottenForm.example';
|
||||
import * as PasswordForgottenForm
|
||||
from './containers/PasswordForgottenForm/PasswordForgottenForm.example';
|
||||
import * as SignUpForm from './containers/SignUpForm/SignUpForm.example';
|
||||
|
||||
export {
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ export const withFlattenedRoutes = Component => {
|
|||
<Component flattenedRoutes={context.flattenedRoutes} {...props} />
|
||||
);
|
||||
|
||||
WithFlattenedRoutesComponent.displayName = `withFlattenedRoutes(${Component.displayName ||
|
||||
Component.name})`;
|
||||
WithFlattenedRoutesComponent.displayName = `withFlattenedRoutes(${Component.displayName || Component.name})`;
|
||||
|
||||
const { arrayOf } = PropTypes;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,12 @@ const SUCCESS = 'SUCCESS';
|
|||
const FAILURE = 'FAILURE';
|
||||
|
||||
// response format: { REQUEST: 'baseStr.REQUEST', SUCCESS: 'baseStr.SUCCESS', FAILURE: 'baseStr.FAILURE' }
|
||||
export const createRequestTypes = base => [REQUEST, SUCCESS, FAILURE].reduce((acc, type) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
acc[type] = `${base}.${type}`;
|
||||
return acc;
|
||||
}, {});
|
||||
export const createRequestTypes = base => [REQUEST, SUCCESS, FAILURE].reduce(
|
||||
(acc, type) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
acc[type] = `${base}.${type}`;
|
||||
return acc;
|
||||
},
|
||||
{},
|
||||
);
|
||||
/* eslint-enable import/prefer-default-export */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue