Skip to content

Added node search by predicate#718

Merged
ystrot merged 2 commits intoexyte:masterfrom
devpolant:feature/search-by-predicate
Jul 20, 2020
Merged

Added node search by predicate#718
ystrot merged 2 commits intoexyte:masterfrom
devpolant:feature/search-by-predicate

Conversation

@devpolant
Copy link
Copy Markdown

Intention

  • Sometimes we want to search by some custom predicate. We may want to search by some id's prefix, regex, etc.

Updates

  • func nodeBy(tag:) is left, but added func nodeBy(predicate:) which is more customisable (see 'Intention' paragraph).

@ystrot
Copy link
Copy Markdown
Member

ystrot commented Jul 17, 2020

Hi @AntonPoltoratskyi!

I think it's a good idea, however it would be better to have even more generic approach:

func nodeBy(predicate: (Node) -> Bool) -> Node?

func nodesBy(predicate: (Node) -> Bool) -> [Node]

Could you please update your PR so I can merge your work?

@ystrot ystrot self-assigned this Jul 17, 2020
@ystrot ystrot added this to the 0.9.7 milestone Jul 17, 2020
@devpolant
Copy link
Copy Markdown
Author

Sure, I will push updates today or tomorrow

@devpolant
Copy link
Copy Markdown
Author

Hi @ystrot ! I pushed updates

@ystrot ystrot merged commit e00baaa into exyte:master Jul 20, 2020
@ystrot
Copy link
Copy Markdown
Member

ystrot commented Jul 20, 2020

Awesome, thank you! Merged it.

@devpolant devpolant deleted the feature/search-by-predicate branch August 3, 2020 11:31
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