-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add runOnJS types #1392
Add runOnJS types #1392
Conversation
I've also noticed that types for |
Hey, I've added types for |
Looks good, I think color space can be optional, no? Also on a side note, I'd recommend not using enums. Consider the following: import { ColorSpace } from '...';
const x = interpolateColor(y, [0, 1], ['#fff', '#000'], ColorSpace.RGB); which would so much cleaner if it were written like this: const x = interpolateColor(y, [0, 1], ['#fff', '#000'], 'rgb'); Same applies for the { extrapolate: 'clamp' } to { extrapolate: Extrapolate.CLAMP } as this way I don't need an extra import, don't need to wait for my IDE (or typescript) to show me what values This doesn't have anything to do with this PR in particular, thought I'd just point this out to consider this before reanimated v2 is initially released, as breaking changes wouldn't be a problem in an alpha. Thoughts? @karol-bisztyga @Szymon20000 @kmagiera @wcandillon @terrysahaidak |
@mrousavy I think this discussion should be moved into a new issue. Agreed, string unions are way cleaner and I'm pretty sure no one wants runtime behavior of enums (e.g. enumerating possible values) but I may be wrong.
Definitely, we default to RGB space in JS. |
@mrousavy thanks for the review, I updated the code |
Description
interpolateColor
- thanks to @mrousavyenum
with string union