Application Framework Reference

Module API

withEachDescendant()

The withEachDescendant() method passes each descendant module of the current module to the specified callback function.

Synopsis

status = withEachDescendant( callback )

Parameters

callback

Function

Function that acts on descendant module passed as an argument.

Return Value

Boolean

Status indication:

True = Descendant modules successfully traversed.

False = The callback function returned False for one of the descendants; operation terminated.

Example

someChildrenRequireDispatch: function(search) {
    var requireDispatch = false;
    this.withEachChild(function(child) {
        if (child.requiresDispatch(search)) {
            requireDispatch = true;
            return false;
        }
    });
    return requireDispatch;
},
 

See Also

someChildrenRequireDispatch()
withEachAncestor()
withEachDescendant()