Miguel-Fontes
7/11/2018 - 2:19 AM

MutationObserver

MutationObserver

    function subscribeCardListObserver() {
        var observer = new MutationObserver(function (mutations) {
            mutations.forEach(function (mutation) {
                iterable({ collection: mutation.addedNodes })
                    .filter(node => isACard(node))
                    .findFirst()
                    .ifPresent(node => updateCounterValue());
            });
        });
        observer.observe(references.components.cards, { childList: true });
    }