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

fix(250): allow using refetch in children components #252

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

simoneb
Copy link
Owner

@simoneb simoneb commented Jun 15, 2020

Fixes #250 by using useLayoutEffect instead of useEffect

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2020

Codecov Report

Merging #252 into master will increase coverage by 1.52%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #252      +/-   ##
==========================================
+ Coverage   77.31%   78.84%   +1.52%     
==========================================
  Files           2        2              
  Lines          97      104       +7     
  Branches       14       15       +1     
==========================================
+ Hits           75       82       +7     
  Misses         21       21              
  Partials        1        1              
Impacted Files Coverage Δ
src/index.js 77.89% <100.00%> (+1.75%) ⬆️

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 66c2fbd...0de127e. Read the comment docs.

@simoneb simoneb force-pushed the fix/250/refetch-in-children-components branch 7 times, most recently from a0a2f11 to d80067b Compare June 21, 2020 12:35
fixes #250

This will make it possible to pass the refetch function down to children component and let them
invoke it, without erroring on a missing token.

New behavior: cancelation errors are thrown for requests generated by the `refetch` function.
This is more consistent with how response and other errors are returned when fetching manually.
@simoneb simoneb force-pushed the fix/250/refetch-in-children-components branch from d80067b to 0de127e Compare June 21, 2020 12:37
@simoneb simoneb merged commit 2042e80 into master Jun 21, 2020
@simoneb simoneb deleted the fix/250/refetch-in-children-components branch June 21, 2020 12:39
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.

Refetch function throwing: Cannot read property 'token' of undefined
2 participants