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
Various fixes to increase parity with jQuery API #21
Various fixes to increase parity with jQuery API #21
Conversation
|
||
Note: can only be called on a wrapper of a single node. | ||
|
||
|
||
#### Arguments | ||
|
||
1. `selector` (`String|Function` [optional]): The selector to filter the parents by. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the documentation above doesn't talk about what arguments the function would take, and what it'd return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added:
Optionally, a selector can be provided and it will filter the parents by this selector
Does that not do what you're meaning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That talks about String
but not Function
(in the type signature)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the context of reagent, a "selector" can be a function in addition to a string. More specifically, if it is a function it assumes you are passing in a valid react component constructor and will select for that. In this documentation, every "selector" argument has a type signature of String|Function
63b9f0e
to
6616eb1
Compare
LGTM |
…children Various fixes to increase parity with jQuery API
Couple of things in this PR:
.children()
(Issue Add an optional arg to.children()
to filter the results by a selector #5).parents()
.parent()
to work when called on wrapper with multiple nodes (Issue Make.parent()
work for non-single node wrappers #10).closest()
to include testing itself (BREAKING CHANGE) (Issue Should.closest()
include the node it's being called on for parity with jQuery? #8)