-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow numbers and objects in filters #19
Allow numbers and objects in filters #19
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 6 6
Lines 78 78
Branches 18 18
=====================================
Hits 78 78
Continue to review full report at Codecov.
|
e2ad40b
to
895e071
Compare
Thanks for tackling the issue @bfirsh! @green-arrow any chance of a merge sometime soon? |
@bfirsh - First off, thanks for working on this! In looking at the docs, it looks like the third item in the array is the only one that is allowed to be a It would also then be possible to write some tests for that function that verify an error is thrown if the props don't match the custom shape. This is something like what I was thinking:
Then the
Reference: https://reactjs.org/docs/typechecking-with-proptypes.html#react.proptypes Relevant example from reference:
Please let me know if that made sense or if something about it doesn't seem right! |
That makes sense. It sounds rather overkill though - will this actually catch errors that a user might make? I haven’t got time to do such an extended fix right now. Feel free to merge this now as a quick fix, if you’d like, and I could tackle it at some point in the future. :) |
Come to think of it, I'll add documentation first. That'll be much more useful than a really comprehensive propType. There isn't even documentation about filtering by references in the official docs. |
@bfirsh - sounds like a plan! Let me know when you add documentation and we'll get this merged. |
5ec9294
to
f998069
Compare
The precommit hook did this automatically.
For example: `filter={["thing", "==", db.doc("things/" + thing)]}` fix green-arrow#16
f998069
to
3192249
Compare
Okay done a couple of things:
The precommit hook seemed to reformat the readme, so I split that out into a separate commit to make my change clear. |
@bfirsh - thanks again for your work on this! |
For example:
filter={["thing", "==", db.doc("things/" + thing)]}
Fixes #16