grafana/public/app/features/plugins/state/reducers.ts
Peter Holmberg e8cc0f3fff render list
2018-09-25 14:53:55 +02:00

17 lines
442 B
TypeScript

import { Action, ActionTypes } from './actions';
import { Plugin, PluginsState } from 'app/types';
export const initialState: PluginsState = { plugins: [] as Plugin[] };
export const pluginsReducer = (state = initialState, action: Action): PluginsState => {
switch (action.type) {
case ActionTypes.LoadPlugins:
return { ...state, plugins: action.payload };
}
return state;
};
export default {
plugins: pluginsReducer,
};