Skip to content

Fix applyParamsToQuery: make equalTo, startAt and endAt parse numbers… #94

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

Merged
merged 1 commit into from
Mar 25, 2017

Conversation

biomorgoth
Copy link
Contributor

… correctly if needed.

Solves issue #92

@codecov
Copy link

codecov bot commented Mar 24, 2017

Codecov Report

Merging #94 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
- Coverage   88.77%   88.75%   -0.02%     
==========================================
  Files          17       17              
  Lines        1354     1361       +7     
  Branches      224      225       +1     
==========================================
+ Hits         1202     1208       +6     
- Misses        152      153       +1

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 01bc76a...49df7eb. Read the comment docs.

@@ -2,6 +2,14 @@ import { actionTypes } from '../constants'

const { UNSET_LISTENER } = actionTypes

const tryParseToNumber = (value) => {
const result = Number(value)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't ever throw does it? even if value is undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to MDN:

If the argument cannot be converted into a number, it returns NaN.

And effectively, i've just tested in Chrome, Firefox and Node and Number(undefined) returns NaN. So, tryParseToNumber would return the undefined itself.

@prescottprue prescottprue merged commit ca49464 into prescottprue:master Mar 25, 2017
@prescottprue
Copy link
Owner

Great fix!

Planning on releasing this in a patch sometime today (hopefully after adding to the tests to cover this). Will post here on release even though issue will be closed.

prescottprue added a commit that referenced this pull request Mar 25, 2017
* Includes #94 - Fix query params containing numbers
* Includes recent docs updates
@prescottprue prescottprue mentioned this pull request Mar 25, 2017
prescottprue added a commit that referenced this pull request Mar 25, 2017
### Enhancements
* #92, #94 - Issue with query params containing numbers (thanks @biomorgoth)
* #82, #83 - dispatch parameter fixed in `unWatchEvent`
* #89 - Separate sections added to docs for [`props.firebase`](http://react-redux-firebase.com/docs/api/props-firebase.html) and [`getFirebase`](http://react-redux-firebase.com/docs/api/get-firebase.html)
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