| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | // @flow
import { ReducerRegistry } from '../base/redux';
import {
    SET_FILMSTRIP_ENABLED,
    SET_FILMSTRIP_HOVERED,
    SET_FILMSTRIP_VISIBLE
} from './actionTypes';
const DEFAULT_STATE = {
    /**
     * The indicator which determines whether the {@link Filmstrip} is enabled.
     *
     * @public
     * @type {boolean}
     */
    enabled: true,
    /**
     * The indicator which determines whether the {@link Filmstrip} is visible.
     *
     * @public
     * @type {boolean}
     */
    visible: true
};
ReducerRegistry.register(
    'features/filmstrip',
    (state = DEFAULT_STATE, action) => {
        switch (action.type) {
        case SET_FILMSTRIP_ENABLED:
            return {
                ...state,
                enabled: action.enabled
            };
        case SET_FILMSTRIP_HOVERED:
            return {
                ...state,
                /**
                 * The indicator which determines whether the {@link Filmstrip}
                 * is being hovered (over).
                 *
                 * @public
                 * @type {boolean}
                 */
                hovered: action.hovered
            };
        case SET_FILMSTRIP_VISIBLE:
            return {
                ...state,
                visible: action.visible
            };
        }
        return state;
    });
 |