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

Update the cache only when isLoading has changed. #521

Merged
merged 2 commits into from Feb 27, 2020

Conversation

jbialobr
Copy link
Contributor

What issue does this pull request resolve?
Fixes #520

What changes did you make?
Store the query result only when we transition from true->false in the isLoading prop.

Is there anything that requires more attention while reviewing?
No.

@ericgio
Copy link
Owner

ericgio commented Feb 26, 2020

Thanks for the PR @jbialobr! If you don't mind resolving the conflicts, I'll go ahead and merge this. Otherwise I can just make the change myself.

@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@bbbd9f1). Click here to learn what that means.
The diff coverage is 99.56%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #521   +/-   ##
=========================================
  Coverage          ?   99.69%           
=========================================
  Files             ?       44           
  Lines             ?      658           
  Branches          ?      129           
=========================================
  Hits              ?      656           
  Misses            ?        2           
  Partials          ?        0
Impacted Files Coverage Δ
src/utils/getMatchBounds.js 100% <ø> (ø)
src/utils/getStringLabelKey.js 100% <ø> (ø)
src/utils/isSelectable.js 100% <ø> (ø)
src/utils/getTruncatedOptions.js 100% <ø> (ø)
src/utils/warn.js 100% <ø> (ø)
src/utils/preventInputBlur.js 100% <ø> (ø)
src/utils/stripDiacritics.js 100% <100%> (ø)
src/components/TypeaheadMenu.react.js 100% <100%> (ø)
src/__tests__/helpers.js 100% <100%> (ø)
src/utils/getIsOnlyResult.js 100% <100%> (ø)
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbbd9f1...5a8b80a. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.696% when pulling 5a8b80a on jbialobr:master into a00edaa on ericgio:master.

@jbialobr
Copy link
Contributor Author

Conflicts resolved. I am happy I could contribute back to your project. Thanks!

@ericgio ericgio merged commit ae59082 into ericgio:master Feb 27, 2020
ericgio added a commit that referenced this pull request Feb 27, 2020
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.

AsyncTypeahead - useCache not working
3 participants