LearnNewsExamplesServices
Frontmatter
id4781
titlecontainer.Base: getItem()
stateClosed
labels
enhancement
assigneestobiu
createdAtAug 25, 2023, 4:28 PM
updatedAtApr 7, 2024, 5:16 PM
githubUrlhttps://github.com/neomjs/neo/issues/4781
authorThorstenRaab
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 7, 2024, 5:16 PM

container.Base: getItem()

Closed v8.1.0 enhancement
ThorstenRaab
ThorstenRaab commented on Aug 25, 2023, 4:28 PM
    /**
    * @param {String} reference
    * @returns {Object|Neo.component.Base|null}
    */
    getItem(reference, items = this.items) {
        let i     = 0,
            len   = items.length,
            item,
            childItem;
        
            for (; i < len; i++) {
                item = items[i];
                if (item.reference === reference) {
                    return item
                } else if (item.items) {
                    childItem = this.getItem(reference, item.items);

                    if (childItem) {
                        return childItem;
                    }
                }
            }
        return null
    }
`

something like this would help to address components better

ThorstenRaab added the enhancement label on Aug 25, 2023, 4:28 PM
tobiu assigned to @tobiu on Apr 7, 2024, 4:47 PM
tobiu referenced in commit a38df7e - "container.Base: getItem() #4781" on Apr 7, 2024, 4:54 PM
tobiu closed this issue on Apr 7, 2024, 5:16 PM