mirror of
https://github.com/strapi/strapi.git
synced 2025-08-10 17:58:07 +00:00
23 lines
528 B
JavaScript
23 lines
528 B
JavaScript
import { fromJS } from 'immutable';
|
|
import {
|
|
UPDATE_PLUGIN,
|
|
PLUGIN_LOADED,
|
|
} from './constants';
|
|
|
|
const initialState = fromJS({
|
|
plugins: {},
|
|
});
|
|
|
|
function appReducer(state = initialState, action) {
|
|
switch (action.type) {
|
|
case PLUGIN_LOADED:
|
|
return state.setIn(['plugins', action.plugin.id], fromJS(action.plugin));
|
|
case UPDATE_PLUGIN:
|
|
return state.setIn(['plugins', action.pluginId, action.updatedKey], fromJS(action.updatedValue));
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
export default appReducer;
|