Files
2024-02-15 17:01:50 +00:00

25 lines
486 B
TypeScript

import {Rect} from 'sentry/utils/profiling/speedscope';
type FlamegraphZoomPositionAction = {
payload: Rect;
type: 'checkpoint';
};
type FlamegraphZoomPosition = {
view: Rect;
};
export function flamegraphZoomPositionReducer(
state: FlamegraphZoomPosition,
action: FlamegraphZoomPositionAction
): FlamegraphZoomPosition {
switch (action.type) {
case 'checkpoint': {
return {view: Rect.From(action.payload)};
}
default: {
return state;
}
}
}