mirror of
https://github.com/strapi/strapi.git
synced 2025-08-03 14:28:40 +00:00
20 lines
375 B
JavaScript
20 lines
375 B
JavaScript
import { fromJS } from 'immutable';
|
|
import {
|
|
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], action.plugin);
|
|
default:
|
|
return state;
|
|
}
|
|
}
|
|
|
|
export default appReducer;
|