This PR adds the agreed status (true or false) to both the component and window consent events. It enables to check whether consent was given or rejected. If a user changes their mind and updates their settings after their initial decision, it’s now possible to act accordingly (and disable analytics tools without reloading the page for example).
It implies a breaking change, since the events will now be fired agreed to or not. Existing code needs to be updated by adding a check for event.detail.agreed. Using the same event as before is more elegant than adding a completely new event with a different naming logic in my opinion (which would be necessary since the original event simply uses its consent type as name).
This PR adds the
agreed
status (true
orfalse
) to both the component and window consent events. It enables to check whether consent was given or rejected. If a user changes their mind and updates their settings after their initial decision, it’s now possible to act accordingly (and disable analytics tools without reloading the page for example).It implies a breaking change, since the events will now be fired agreed to or not. Existing code needs to be updated by adding a check for
event.detail.agreed
. Using the same event as before is more elegant than adding a completely new event with a different naming logic in my opinion (which would be necessary since the original event simply uses its consent type as name).Closes #63