mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-02 09:50:39 +08:00
34 lines
620 B
TypeScript
34 lines
620 B
TypeScript
import { Action, ActionTypes, ServiceMapStore } from 'store/actions';
|
|
|
|
const initialState: ServiceMapStore = {
|
|
items: [],
|
|
services: [],
|
|
loading: true,
|
|
};
|
|
|
|
export const ServiceMapReducer = (
|
|
state = initialState,
|
|
action: Action,
|
|
): ServiceMapStore => {
|
|
switch (action.type) {
|
|
case ActionTypes.getServiceMapItems:
|
|
return {
|
|
...state,
|
|
items: action.payload,
|
|
};
|
|
case ActionTypes.getServices:
|
|
return {
|
|
...state,
|
|
services: action.payload,
|
|
};
|
|
case ActionTypes.serviceMapLoading: {
|
|
return {
|
|
...state,
|
|
loading: action.payload.loading,
|
|
};
|
|
}
|
|
default:
|
|
return state;
|
|
}
|
|
};
|