emit events or states on dom events