-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(story): set default view for globe #198
Conversation
useEffect(() => { | ||
if (slide && slide.flyTo) { | ||
dispatch(setFlyToAction(slide.flyTo)); | ||
} | ||
}, [dispatch, slide]); | ||
if (slide && !slide.flyTo) { | ||
dispatch(setFlyToAction(defaultView)); |
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.
You don't need a second if condition here if you just write:
dispatch(setFlyToAction(slide.flyTo || defaultView));
if (slide && !slide.flyTo) { | ||
dispatch(setFlyToAction(defaultView)); | ||
} | ||
}, [dispatch, slide, defaultView]); |
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.
I guess the defaultView
was added automatically here!? It doesn't make much sense here since it will never change, but never mind.
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.
Yes, it's from our hooks checker plugin. It throws an error/warning if it's not added there.
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.
I thought so. The hooks plugin is... improvable... 😐🤷♀
closes #190