lucassaid / react-native-cool-speedometer

Cool speedometer for React Native
27 stars 20 forks source link

Optimization and little refactoring #4

Closed garrylachman closed 2 years ago

garrylachman commented 3 years ago
  1. Cache the function response using React.useMemo
  2. Little refactor of marks. now its uses state and effect to render only on needed changes.
lucassaid commented 2 years ago

Hey, sorry for the delay, and thanks for your time working on this. Today I released a new version with breaking changes, you might want to have a look! I think we still can apply the major changes in this pr, with some changes:

Unless tehere is something I'm missing, I would use useMemo to genreate the marks instead of useEffect + useState. There are some missing dependencies in other parts.

Also this has now some conflicts because of the recent changes, feel free to either fix them or close the pr. Thanks again and I'm sorry I couldn't take a look before

lucassaid commented 2 years ago

I just made the changes on my own since the code is a little different now, your code was helpful, thanks again! Sorry you won't show up as a collaborator this time, I would like so