Split out settings reducer

This commit is contained in:
Jordan Eldredge 2018-04-02 16:50:00 -07:00
parent 2770b8ca56
commit b8f0ec8947
2 changed files with 17 additions and 14 deletions

View file

@ -1,5 +1,4 @@
import { combineReducers } from "redux";
import { SET_AVAILABLE_SKINS } from "../actionTypes";
import playlist from "./playlist";
import windows from "./windows";
@ -8,19 +7,7 @@ import display from "./display";
import userInput from "./userInput";
import equalizer from "./equalizer";
import network from "./network";
const defaultSettingsState = {
availableSkins: []
};
const settings = (state = defaultSettingsState, action) => {
switch (action.type) {
case SET_AVAILABLE_SKINS:
return { ...state, availableSkins: action.skins };
default:
return state;
}
};
import settings from "./settings";
const reducer = combineReducers({
userInput,

16
js/reducers/settings.js Normal file
View file

@ -0,0 +1,16 @@
import { SET_AVAILABLE_SKINS } from "../actionTypes";
const defaultSettingsState = {
availableSkins: []
};
const settings = (state = defaultSettingsState, action) => {
switch (action.type) {
case SET_AVAILABLE_SKINS:
return { ...state, availableSkins: action.skins };
default:
return state;
}
};
export default settings;