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 onSize callback called whether or not size has changed #116

Merged
merged 2 commits into from
Jun 19, 2017

Conversation

felthy
Copy link
Contributor

@felthy felthy commented May 31, 2017

I noticed that the hasSizeChanged() check was always returning true when in callback mode, because it was comparing to this.state which never changes from its initial state. Changed to compare to this.strategisedGetState() instead, which also necessitated initialising the callback state which I did inside determineStrategy().

All tests passing.

@codecov
Copy link

codecov bot commented May 31, 2017

Codecov Report

Merging #116 into master will increase coverage by 0.3%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #116     +/-   ##
=========================================
+ Coverage   93.67%   93.97%   +0.3%     
=========================================
  Files           3        3             
  Lines          79       83      +4     
  Branches       24       25      +1     
=========================================
+ Hits           74       78      +4     
  Misses          2        2             
  Partials        3        3
Impacted Files Coverage Δ
src/sizeMe.js 100% <100%> (ø) ⬆️

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 1b65bba...cb16eca. Read the comment docs.

@ctrlplusb
Copy link
Owner

Awesome dude thanks for this!

@ctrlplusb ctrlplusb merged commit de56c6c into ctrlplusb:master Jun 19, 2017
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.

None yet

2 participants