summaryrefslogtreecommitdiffstats
path: root/webapp/reducers/plugins/index.js
blob: 9cad72715396ad661db054798529e887aa302b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import {combineReducers} from 'redux';
import {ActionTypes} from 'utils/constants.jsx';

function components(state = {}, action) {
    switch (action.type) {
    case ActionTypes.RECEIVED_PLUGIN_COMPONENTS: {
        if (action.data) {
            return {...action.data, ...state};
        }
        return state;
    }
    default:
        return state;
    }
}

export default combineReducers({
    components
});