Skip to content
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 memoization option to avoid unnecessary requests #173

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SchneiderOr
Copy link

@SchneiderOr SchneiderOr commented Jul 15, 2021

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

@LazyAfternoons
Copy link

@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.

@SchneiderOr
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants