A lightweight Redux-style state management library for Kotlin Multiplatform and Dart/Flutter with Middleware support.
Predictable state management with Reducer pattern, unidirectional data flow, and immutable state.
Side effect handling with execution strategies: takeLatest, debounce, throttle, retry, sequential, and strategy chaining.
Real-time client-server state synchronization over WebSocket with type-safe shared action contracts.
Undo/redo, state history navigation, and branching for debugging and development.
Runs on JVM, Android, iOS, JavaScript, and WebAssembly. Built on Coroutines and Flow.
Full Dart implementation with Flutter widget bindings and Stream-based reactive state.
dependencies {
implementation("com.github.chibimoons:flowdux:1.8.2")
}
dependencies:
flowdux: ^0.2.3
// Define State and Actions
data class CounterState(val count: Int = 0) : State
sealed class CounterAction : Action {
object Increment : CounterAction()
object Decrement : CounterAction()
}
// Create Reducer
val counterReducer = buildReducer<CounterState, CounterAction> {
on<CounterAction.Increment> { state, _ ->
state.copy(count = state.count + 1)
}
}
// Create and Use Store
val store = createStore(
initialState = CounterState(),
reducer = counterReducer,
)
store.state.collect { println("Count: ${it.count}") }
store.dispatch(CounterAction.Increment)
| Platform | Kotlin | Dart |
|---|---|---|
| JVM | Yes | - |
| Android | Yes | - |
| iOS | Yes | - |
| JavaScript | Yes | Yes |
| WebAssembly | Yes | - |
| Flutter | - | Yes |