View Source LiveEvent.LiveComponent (live_event v0.1.0)

Add LiveEvent support to LiveComponents.

Simply add

use LiveEvent.LiveComponent

to your LiveComponent module. See LiveEvent for more information on how to emit and handle events.

The macro imports LiveEvent.emit/3 and hooks into the LiveComponent update lifecycle to add support for the LiveEvent.handle_event/4 callback.