Skip to content

Trigger the event handler when an ancestor gets deleted #74

@jckautzmann

Description

@jckautzmann

Let's consider the following scenario:

// Store `carousel1`:
window.adobeDataLayer.push({
  component: {
    carousel: {
      carousel1: {
        id: '/content/mysite/en/home/jcr:content/root/carousel1',
        shownItems: [
          'item1', 'item2'
        ]
      }
    }
  }
});

// Remove `carousel`:
window.adobeDataLayer.push({
  component: {
    carousel: null
  }
});

// Define an event listener specific to the `carousel1` object:
const callback = function(event) {
  console.log(event);
};
window.adobeDataLayer.addEventListener('adobeDataLayer:change', callback, {path: 'component.carousel.carousel1'});

Expected: both change events should be logged: one for storing carousel1, one for removing carousel (which is an ancestor of carousel1).

This behaviour should happen for any kind of events (data layer specific and custom ones).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions