-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate EventPriority from Lane #25460
Conversation
@@ -80,3 +83,13 @@ export function lanesToEventPriority(lanes: Lanes): EventPriority { | |||
} | |||
return IdleEventPriority; | |||
} | |||
|
|||
export function laneToEventPriority(lane: Lane): EventPriority { | |||
if (lane === DefaultLane) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyao1
Why don't you use switch here?
switch(lane) {
case DefaultLane:
return DefaultEventPriority;
case InputContinuousLane:
return ContinuousEventPriority;
default:
return (lane: any);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are the same. I would use switch if there were more cases to cover.
cfed715
to
96c7ce3
Compare
closing for now since we are starting with the other approach: #25700 |
Summary
Breaks down #25438, we are going to merge Default and Continuous lane into Sync lane, so EventPriority no longer maps to Lane anymore.
How did you test this change?
yarn test
flow
lint