-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix(animation) get/setKeyframes throws when animation isn't defined. #215
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 1685551732Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
It seems like for both cases(existing or non-existing animation), setKeyframes' behavior is identical. Would it be possible for code to get some feedback or differentiate if it couldn't find the animation? |
In normal runtime, I don't think feedback is useful and can effect performance. There's a logger used in other vis.gl libraries that has levels, and I think it'd be great to print that it couldn't be found at a debug level of 3 or 4. I'll take a note to add this once that logger is working in hubble (I ran into integration issues). |
I'm not too familiar with how to get/setKeyframes are being used, but curious to know why it's not ideal to throw an error. If I tried and set animation, and I got a wrong animation id that resulted in getting/SetKeyframes not working, I would want instant feedback on that so I can go back and change my animation id. |
They may be used in an async context where the getter/setter call may be statically defined, but the animation won't be set until the data loads. In that case, returning undefined or doing nothing is useful behavior in the final product. I do think getting some feedback is important, so we can wait to merge until the logger is in place, but I don't typically throw errors unless it's completely necessary. Most JS devs check for undefined. |
Requesting keyframes for animations that aren't defined shouldn't throw, instead a more graceful behavior of returning
undefined
(for get) or doing nothing (for set) is preferred.