Splitting out helpers into separate files

This commit is contained in:
James Barnsley
2020-03-03 16:39:37 +13:00
parent 57dd18e870
commit 5a1f08fdf0
105 changed files with 5456 additions and 5574 deletions

View File

@ -1,7 +1,7 @@
import ReactGA from 'react-ga';
import { arrayOf } from '../../util/arrays';
const helpers = require('../../helpers');
const coreActions = require('../core/actions');
const mopidyActions = require('../mopidy/actions');
const uiActions = require('../ui/actions');
@ -38,7 +38,7 @@ const GoogleMiddleware = (function () {
return;
}
const uris = helpers.arrayOf('uri', response);
const uris = arrayOf('uri', response);
store.dispatch({
type: 'GOOGLE_LIBRARY_ALBUMS_LOADED',
uris,

View File

@ -1,8 +1,8 @@
import * as helpers from '../../helpers';
import { removeDuplicates } from '../../util/arrays';
export default function reducer(google = {}, action) {
switch (action.type) {
switch (action.type) {
case 'GOOGLE_SET':
return { ...google, ...action.data };
@ -12,7 +12,7 @@ export default function reducer(google = {}, action) {
} else {
var { uris } = action;
}
return { ...google, library_artists: helpers.removeDuplicates(uris) };
return { ...google, library_artists: removeDuplicates(uris) };
case 'GOOGLE_CLEAR_LIBRARY_ARTISTS':
return { ...google, library_artists: null };
@ -23,7 +23,7 @@ export default function reducer(google = {}, action) {
} else {
var { uris } = action;
}
return { ...google, library_albums: helpers.removeDuplicates(uris) };
return { ...google, library_albums: removeDuplicates(uris) };
case 'GOOGLE_CLEAR_LIBRARY_ALBUMS':
return { ...google, library_albums: null };