MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / eachDescendant

Function eachDescendant

packages/core/ui/core/view-base/index.ts:227–243  ·  view source on GitHub ↗
(view: ViewBase, callback: (child: ViewBase) => boolean)

Source from the content-addressed store, hash-verified

225 * @param callback - A function to execute on every child. If function returns false it breaks the iteration.
226 */
227export function eachDescendant(view: ViewBase, callback: (child: ViewBase) => boolean) {
228 if (!callback || !view) {
229 return;
230 }
231
232 let continueIteration: boolean;
233 const localCallback = function (child: ViewBase): boolean {
234 continueIteration = callback(child);
235 if (continueIteration) {
236 child.eachChild(localCallback);
237 }
238
239 return continueIteration;
240 };
241
242 view.eachChild(localCallback);
243}
244
245let viewIdCounter = 1;
246

Callers 10

testActionFunction · 0.90
testFunction · 0.90
resetStylesFunction · 0.90
resetStylesFunction · 0.90
resetStylesFunction · 0.90
resetStylesFunction · 0.90
getViewByIdFunction · 0.85
getViewByDomIdFunction · 0.85
querySelectorAllFunction · 0.85
_onCssStateChangeFunction · 0.85

Calls 1

eachChildMethod · 0.45

Tested by 1

testFunction · 0.72