Splitting out helpers into separate files
This commit is contained in:
@ -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,
|
||||
|
||||
@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user