mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
25 lines
486 B
TypeScript
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;
|
|
}
|
|
}
|
|
}
|