API Overview
PulseDesktop exposes a small, focused API surface. One package per artifact: mvi is the core and lives in jp.kaleidot725.pulse.mvi, while the optional navigation and architecture artifacts live in jp.kaleidot725.pulse.navigation and jp.kaleidot725.pulse.architecture. Both are listed under Extensions.
Classes
| Class | Description |
|---|---|
PulseViewModel | Abstract base class for managing UI state |
PulseContainer | Coordinates multiple ViewModels |
Composables
| Composable | Description |
|---|---|
PulseHost | Scopes a Container to a subtree; enables refresh and broadcast callbacks |
PulseContent | Observes a ViewModel; provides state and action dispatcher |
Marker Interfaces
| Interface | Description |
|---|---|
PulseState | Marks a class as a ViewModel's UI state |
PulseAction | Marks a class as a user action |
PulseEvent | Marks a class as a one-time side effect |
PulseBroadcast | Marks a class as a Container broadcast message |
PulseUnicast | Marks a class as a child-to-parent unicast message |
Extensions
Navigation 3
| Composable | Description |
|---|---|
rememberPulseViewModel | ViewModel scoped to a ViewModelStoreOwner |
rememberPulseContainer | Container scoped to a ViewModelStoreOwner |
rememberPulseNavEntryDecorators | NavDisplay decorators that scope ViewModels to a back stack entry |
Architecture checks
| Assertion | Description |
|---|---|
assertPulseMviConventions | The next twelve checks, in order |
assertStatesAreDataTypes | A PulseState is a data class or data object |
assertMessagesAreSealedOrDataTypes | A message is a sealed class with data class / data object cases, or a single data class / data object |
assertStatesAndMessagesLiveInContracts | States and messages are in a …Contracts.kt beside their ViewModel or Container |
assertViewModelsAndContainersAreNamedAfterTheirBase | …ViewModel and …Container |
assertViewModelsHoldTheirDataInTheirState | No var property on a ViewModel or Container |
assertViewModelsLiveInContents | A ViewModel lives under content |
assertContainersLiveAtTheFeatureRoot | A Container lives at the feature root |
assertHostsComposeContents | A host is named …Host and composes contents instead of binding a ViewModel |
assertFeaturePackagesHaveARole | A file in a feature is at its root or under content, section or component |
assertContentsBindAViewModel | A content binds its ViewModel with PulseContent |
assertSectionsAndComponentsArePure | Sections and components take data and callbacks only |
assertSectionsAndComponentsHavePreviews | Every section and component has a <Name>_Preview |
assertPulseDomainConventions | A repository exposes flows and returns Result<V, E> from one-shot calls; a use case lives in usecase and is more than one line |
assertPulseModuleConventions | Modules depend on each other the way Clean Architecture asks, and the domain, data and design system are split into packages |
assertPulseKoinConventions | Koin modules are declared in the app module |
assertPulseResourceConventions | The domain holds no text, and composables read their text from string resources |
PulseModuleLayout | Which module names play which layer |