Lifecycle Events
Reef emits custom events throughout the lifecycle of a reactive signal or component.
reef:signalis emitted when a signal is modified. Theevent.detailproperty contains thepropandvaluethat were changed, and theactionthat was done to the data.reef:startis emitted on a component element when reef starts listening for reactive data changes.reef:stopis emitted on a component element when reef stops listening for reactive data changes.reef:before-renderis emitted on a component element before it renders a UI update. Running theevent.preventDefault()method will cancel the render.reef:renderis emitted on a component element when reef renders a UI update.
You can listen for Reef events with the Element.addEventListener() method.
// Log whenever an element is rendered into
document.addEventListener('reef:render', function (event) {
console.log('The UI was just updated inside this element.');
console.log(event.target);
});