diff options
Diffstat (limited to 'front/odiparpack/app/containers/LanguageProvider/reducer.js')
| -rw-r--r-- | front/odiparpack/app/containers/LanguageProvider/reducer.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/front/odiparpack/app/containers/LanguageProvider/reducer.js b/front/odiparpack/app/containers/LanguageProvider/reducer.js new file mode 100644 index 0000000..089c426 --- /dev/null +++ b/front/odiparpack/app/containers/LanguageProvider/reducer.js @@ -0,0 +1,25 @@ +/* + * + * LanguageProvider reducer + * + */ + +import { fromJS } from 'immutable'; + +import CHANGE_LOCALE from './constants'; +import { DEFAULT_LOCALE } from '../../i18n'; // eslint-disable-line + +export const initialState = fromJS({ + locale: DEFAULT_LOCALE, +}); + +function languageProviderReducer(state = initialState, action) { + switch (action.type) { + case CHANGE_LOCALE: + return state.set('locale', action.locale); + default: + return state; + } +} + +export default languageProviderReducer; |
