mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
17 lines
442 B
TypeScript
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,
|
|
};
|