From b8f0ec89474ef0df7a6854ce2b578a90320e0988 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 2 Apr 2018 16:50:00 -0700 Subject: [PATCH] Split out settings reducer --- js/reducers/index.js | 15 +-------------- js/reducers/settings.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 js/reducers/settings.js diff --git a/js/reducers/index.js b/js/reducers/index.js index de53aa9b..d871053a 100644 --- a/js/reducers/index.js +++ b/js/reducers/index.js @@ -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, diff --git a/js/reducers/settings.js b/js/reducers/settings.js new file mode 100644 index 00000000..eebf9783 --- /dev/null +++ b/js/reducers/settings.js @@ -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;