| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| 2.0.0 source code.tar.gz | 2025-11-25 | 374.4 kB | |
| 2.0.0 source code.zip | 2025-11-25 | 474.8 kB | |
| README.md | 2025-11-25 | 2.7 kB | |
| Totals: 3 Items | 851.9 kB | 0 | |
- New artifact coordinates:
com.freeletics.flowredux2:flowredux:<version>. - New package name:
com.freeletics.flowredux2
General changes:
- The main class to define your state machine is now
FlowReduxStateMachineFactorywhich can be started withlaunchIn/shareIn(Coroutines) orproduceStateMachine(Compose). Both return an activeFlowReduxStateMachinethat allows dispatching actions to it and observing the current state. - The initial state of the
FlowReduxStateMachineFactoryis now provided by callinginitializeWith { initialState }. Usually this is done in theinitblock of the state machine factory. By default the each launch of the factory will resume with the last emitted state of a previous launch. To always start with a fresh initial state useinitializeWith(reuseLastEmittedStateOnLaunch = false) { initialState }. There are also several overloads ofinitializeWiththat allow to useSavedStateHandleto persist the previous state. It can also be used to change the initial state in tests by callingfactory.initializeWith { testState }before launching a state machine.
DSL:
- The
Stateclass that has theoverride,mutateandnoStateChangemethods is now calledChangeableStateand is the receiver in each DSL block instead of being passed as a parameter. Like beforeChangeableStateallows access to asnapshotstate. ...Effectmethods now have aStateclass as receiver that allow accessingsnapshotinstead of receivingsnapshotas a parameter.- It's now forbidden to access
snapshotin theoverrideandmutatemethods to avoid accidental bugs where outdated state is used to build the new state. - Added
ExecutionPolicy.Throttledthat can be used to limit subsequent action handling or Flow emissions (already was part of alpha 1 but not mentioned in the release notes).
Other:
- The old compose artifact was removed in favor of the previously mentioned
produceStateMachinewhich ships as part of the main library. - Added new artifact
com.freeletics.flowredux2:flowredux-extensions:<version>which initially containsonEnterLoadSmoothly. This extension allows loading data while skipping showing a loading indicator for fast loads and if a loading indicator is shown it will show it at least for a minimum amount of time. This avoids the loading indicator just quickly flashing. - Added
cancelOnStatetoonEnterStartStateMachineandonActionStartStateMachine - Added
LoggerandinstallLoggerto allow logging of state changes and state machine events. ...EffectDSL methods won't cause the previous state to be emitted again when they complete.