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

when() #70

Closed
swathiiyer2 opened this issue Aug 15, 2017 · 2 comments
Closed

when() #70

swathiiyer2 opened this issue Aug 15, 2017 · 2 comments

Comments

@swathiiyer2
Copy link
Contributor

Takes a predicate that can further specify which nodes to select

Example:
type(‘priceish’).when(fnode => fnode.element.tagName.len > 5)

Maintain an array of predicates in the higher level Lhs class. when function in Lhs adds predicate to the array. Other Lhs subclasses check that all predicates in the array are satisfied before returning the element.

@erikrose
Copy link
Contributor

I assume you also plan for .when() to work on dom() LHSs as we talked about yesterday, since you're proposing to implement it in the top-level Lhs class. Sounds good to me. Go for it.

@erikrose
Copy link
Contributor

Long-fixed

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

No branches or pull requests

2 participants