From 60c29b2a4b7a833e80f8a2102ee5ef4e9f44a7bb Mon Sep 17 00:00:00 2001 From: Lucas Bebber Date: Thu, 4 Apr 2019 11:56:01 -0300 Subject: [PATCH] Create ActionTypes enum --- react/hooks/useCumulativeHeightState.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/react/hooks/useCumulativeHeightState.tsx b/react/hooks/useCumulativeHeightState.tsx index fc709967..9904e304 100644 --- a/react/hooks/useCumulativeHeightState.tsx +++ b/react/hooks/useCumulativeHeightState.tsx @@ -4,8 +4,11 @@ interface State { [id: string]: number } +enum ActionTypes { + UPDATE = 'update', +} interface UpdateAction { - type: 'update' + type: ActionTypes.UPDATE, payload: { index: number height: number @@ -39,7 +42,7 @@ const useCumulativeHeightState = () => { height, index, }, - type: 'update', + type: ActionTypes.UPDATE, }) }