grafana/public/app/core/reducers/user.ts
Peter Holmberg 58e94fc0fa moved state
2018-10-30 13:09:59 +01:00

16 lines
452 B
TypeScript

import { DashboardSearchHit, UserState } from '../../types';
import { Action, ActionTypes } from '../actions/user';
const initialState: UserState = {
starredDashboards: [] as DashboardSearchHit[],
};
export const userReducer = (state: UserState = initialState, action: Action): UserState => {
switch (action.type) {
case ActionTypes.LoadStarredDashboards:
return { ...state, starredDashboards: action.payload };
}
return state;
};