Event

beforeUpdate

Dispatched synchronously at the start of update(), before the new code is generated.

Syntax

  • doodle.addEventListener('beforeUpdate', handler)

Fires for every update: manual, click:update and auto:update. The seed of the outgoing render is still readable here.

Examples

const doodle = document.querySelector('css-doodle');

doodle.addEventListener('beforeUpdate', () => {
  history.push(doodle.seed);
});

See also