2017-10-13 16:13:46 +00:00
|
|
|
import { ReducerRegistry, set } from '../redux';
|
|
|
|
|
|
|
|
import { SET_ASPECT_RATIO } from './actionTypes';
|
|
|
|
import { ASPECT_RATIO_NARROW } from './constants';
|
|
|
|
|
2017-11-07 14:28:08 +00:00
|
|
|
/**
|
|
|
|
* The initial redux state of the feature base/aspect-ratio.
|
|
|
|
*/
|
|
|
|
const _INITIAL_STATE = {
|
2017-10-13 16:13:46 +00:00
|
|
|
aspectRatio: ASPECT_RATIO_NARROW
|
|
|
|
};
|
|
|
|
|
|
|
|
ReducerRegistry.register(
|
2017-11-07 14:28:08 +00:00
|
|
|
'features/base/aspect-ratio',
|
|
|
|
(state = _INITIAL_STATE, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case SET_ASPECT_RATIO:
|
|
|
|
return set(state, 'aspectRatio', action.aspectRatio);
|
|
|
|
}
|
2017-10-13 16:13:46 +00:00
|
|
|
|
2017-11-07 14:28:08 +00:00
|
|
|
return state;
|
|
|
|
});
|