I had trouble using this lib when trying out getChildrenByTypeDeep, with my nested custom components.
The behaviour I wanted was fetching CustomComponentGroup or CustomComponent but not go any deeper in the search tree when a match is found. The current behaviour would return me all 5 matches, while it would like to tweak the searching behaviour so it won't return any CustomComponents found inside the CustomComponentGroup. This is illustrated in the updated test cases.
To solve this, i added a custom parameter skipWhenFound (by default false), that will skip the search if something was found. This way the old behaviour is intact, but the option exist to turn on the new feature.
Added test cases to the getChildrenByTypeDeep file showing this would be a non breaking change. Any comments always welcome ;)
Hi!
I had trouble using this lib when trying out getChildrenByTypeDeep, with my nested custom components.
The behaviour I wanted was fetching
CustomComponentGroup
orCustomComponent
but not go any deeper in the search tree when a match is found. The current behaviour would return me all 5 matches, while it would like to tweak the searching behaviour so it won't return anyCustomComponents
found inside theCustomComponentGroup
. This is illustrated in the updated test cases.To solve this, i added a custom parameter
skipWhenFound
(by default false), that will skip the search if something was found. This way the old behaviour is intact, but the option exist to turn on the new feature.Added test cases to the getChildrenByTypeDeep file showing this would be a non breaking change. Any comments always welcome ;)