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