Add .if_exists()/.if_visible() (implements #266)
I'm not sure how I feel about these functions. They feel unnecessary to me.
If other people want them I might pull them in. Do you have an opinion @johntitus?
Also, the underscores in the name irk me, the do not match any of the other function names.
Regarding underscores - would this sort of syntax be more palatable?
.visible('#foo')
.if(function() {
...
i.e. add new if action that does the same as then, but conditionally.
I would have just made them .ifExists and .ifVisible
Oh, I see. Cool. I've changed PR to use headlessCamelCase.
Seems useful but I too hesitate to go too far down this sort of rabbit hole. I lean towards accepting this PR (and thanks for making it @aexaey) if tests are added.
Thanks @johntitus , I've added tests and bare-bones descriptions to Readme.md. Let me know if you'd like this PR squashed into a single commit.