Changelog
What changed in each version of Eventus, newest first. Versions follow semantic versioning.
1.0.0-rc03 (not released yet)
Added
-
Effects in the router's reports. A router with an
observernow reports each effect at the moment it is emitted, with the event it came from:#3 OnSaveClick emitted Close. That includes an effect the screen'sErrorHandleremits for a failed event. The UI still gets every effect. See logging events. -
A build error for an event handler that Metro would leave out. With
@ContributesEventHandlers, a handler that implementsEventHandlerdirectly, and not the annotated interface of its screen, now fails the build. Before, the build passed and the screen threw when that event was sent.
Changed
RouterTracehas a new report,EffectEmitted. Awhenthat lists every report and has noelseno longer compiles until it lists the new one. A one-line observer, such asobserver = { println(it) }, needs no change.
1.0.0-rc02 (2026-11-23)
Added
- Metro support.
eventus-kspgenerates the Metro bindings of a screen's event handlers from one annotation on the screen's handler interface,@ContributesEventHandlers(AppScope::class). The view model injectsSet<TaskListHandler<*>>, and the event handler classes take no annotation. It works in multiplatform modules and in modules with a single platform, and across Gradle modules. Written for and tested with Metro 1.6.0. See checking and wiring event handlers at build time. eventus-metro: a new artifact that holds that annotation and nothing else.- A build-time check of a view model's event type.
eventus-kspnow fails the build when a class that implementsEventRouterroutes a wider type than it can handle: for example, a view model that routes a whole feature's event type while other view models handle parts of it. Before, such a view model threw when it was sent one of those events. See several view models in one feature.
1.0.0-rc01 (2026-11-22)
The first release. It is a release candidate: the API is meant to stay as it is, and this version is for trying it in real apps before 1.0.0.
What the library does
- Routes each UI event of a screen to its own event handler class. A view model implements
EventRouterby delegation and extends nothing from the library. - Keeps the screen's state and effects in one store, which the router creates and passes to
every event handler. State is one immutable value in a
StateFlow. Each effect is delivered once. - Decides what happens when events overlap, with a dispatch strategy for each event handler.
Four are ready-made:
Concurrent,Latest,SequentialandDropIfAlreadyRunning. Each of the last three names the events it looks at: the handler's own event, a type that several events share, or a type and a key for each item of a list. A strategy can also be a function of your own. - Sends every failure of an event handler to one
ErrorHandlerfor the screen. - Updates the state optimistically in one call, and puts it back if the work fails.
- Reports what it does with each event to an optional
RouterObserver: what ran, what was ignored, what was replaced and how each run ended. One line of code gives a log. - Lives as long as the scope it is given. In a view model, a rotation does not interrupt a running event.
The artifacts
eventus: the library. It depends onkotlinx.coroutinesandatomicfu.eventus-ksp: an optional symbol processor. It fails the build when an event has no handler class or more than one, and it can generate the Koin module of a module's handlers.eventus-koin: the annotation that askseventus-kspfor that Koin module.eventus-compose: optional helpers for a Compose UI.collectEffectsperforms a router's effects while the screen is started, andnotifyVisibilitytells the router when the screen is visible.
Requirements
- Kotlin 2.4.21 or newer.
- Targets:
android(minSdk 24),jvm,iosArm64,iosSimulatorArm64,iosX64,jsandwasmJs.eventus-composehas all of them exceptiosX64.
For AI agents
The guide for AI agents is one file with what an agent needs to use the library, and skills it can save.