react-native-maps-directions icon indicating copy to clipboard operation
react-native-maps-directions copied to clipboard

Add memoization option to avoid unnecessary requests

Open SchneiderOr opened this issue 4 years ago • 2 comments

What changed?

I've added another prop that the component can take called isMemoized, by default requests are not memoized, but if you pass either boolean or a callback function you can decide when you want to memoize the request, if you pass only true to the isMemoized, memoization will be by the callee arguments (origin, destination, region, etc)

This memoize reduce a lot of unnecessary requests and preserve quota

Also in this PR - format the files with formatter rather then keeping them in an inconsistent styling

SchneiderOr avatar Jul 15 '21 15:07 SchneiderOr

@bramus any news for this PR? Looks like something really useful to preserve quota when origin and destination do not change between renders. Thank you for your work.

LazyAfternoons avatar Aug 22 '22 08:08 LazyAfternoons

Im working with this code on my project for few months now and it works very well, Im waiting on project maintainer to decide if he want to merge it down or not

SchneiderOr avatar Nov 03 '22 09:11 SchneiderOr