grafana/public/app/features/api-keys/state/reducers.ts

17 lines
433 B
TypeScript
Raw Normal View History

2018-09-25 09:23:43 -05:00
import { ApiKeysState } from 'app/types';
import { Action, ActionTypes } from './actions';
export const initialApiKeysState: ApiKeysState = { keys: [] };
export const apiKeysReducer = (state = initialApiKeysState, action: Action): ApiKeysState => {
switch (action.type) {
case ActionTypes.LoadApiKeys:
return { ...state, keys: action.payload };
}
return state;
};
export default {
apiKeys: apiKeysReducer,
};