Skip to content

Commit

Permalink
memoize fn call
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelolo24 committed Apr 16, 2024
1 parent 65a7b6b commit 688ec93
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -3,7 +3,7 @@ import { useMemo } from "react";
import { getEventType, isEvenEqlSequence, isEventBuildingBlockType } from "../../body/helpers";

export const useEventTypeRowStyling = (ecsData: TimelineItem['ecs']) => {
const eventType = getEventType(ecsData);
const eventType = useMemo(() => getEventType(ecsData), []);
const eventTypeClassName = useMemo(
() =>
eventType === 'raw'
Expand All @@ -20,5 +20,5 @@ export const useEventTypeRowStyling = (ecsData: TimelineItem['ecs']) => {
[ecsData]
);

return useMemo(() => [eventTypeClassName, buildingBlockTypeClassName].join(' '), []);
return useMemo(() => `${eventTypeClassName} ${buildingBlockTypeClassName}`, []);
}

0 comments on commit 688ec93

Please sign in to comment.