eeue56 / elm-html-query

BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

Are these functions the same? queryInNode, queryChildren #8

Open SamGerber-zz opened 7 years ago

SamGerber-zz commented 7 years ago

https://github.com/eeue56/elm-html-query/blob/6dbe1bca11627ade6cffe2f06611294c3ea1de66/src/ElmHtml/Query.elm#L114-L117

https://github.com/eeue56/elm-html-query/blob/6dbe1bca11627ade6cffe2f06611294c3ea1de66/src/ElmHtml/Query.elm#L122-L125

It seems like queryInNode descends indefinitely while queryChildren only descends one level?

stoeffel commented 7 years ago

nope:

queryInNode : Selector -> ElmHtml msg -> List (ElmHtml msg)
queryInNode =
    queryInNodeHelp Nothing

{-| Query an ElmHtml node using a selector, considering both the node itself
as well as all of its descendants.
-}
queryChildren : Selector -> ElmHtml msg -> List (ElmHtml msg)
queryChildren =
    queryInNodeHelp (Just 1)

queryInNode queries all sub nodes and queryChildren queries only one level.

eeue56 commented 7 years ago

directChildren, in other words.