Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
2.0.0-alpha1 source code.tar.gz | 2025-07-23 | 576.7 kB | |
2.0.0-alpha1 source code.zip | 2025-07-23 | 679.5 kB | |
README.md | 2025-07-23 | 1.7 kB | |
Totals: 3 Items | 1.3 MB | 0 |
- New artifact coordinates:
com.freeletics.flowredux2:flowredux:<version>
. - New package name:
com.freeletics.flowredux2
General changes:
- The main class to define ypur state machine is now
FlowReduxStateMachineFactory
which can be started withlaunchIn
(Coroutines) orproduceStateMachine
(Compose). Both return an activeFlowReduxStateMachine
that allows dispatching actions to it and observing the current state. - The old compose artifact was removed in favor of the mentioned
produceStateMachine
. FlowReduxStateMachineFactory
offers variousStateHolder
classes that allow to keep the previous state for the next startd state machine. By default the previous state will be kept in memory (inMemoryStateHolder
). Other APIs allow to just drop the previous state (lossyStateHolder
) or useSavedStateHandle
to persist the previous state (savedStateHandleStateHolder
,serializableStateHolder
,parcelableStateHolder
).- The old
FlowReduxStateMachine
is available asLegacyFlowReduxStateMachine
for now.
DSL:
- The
State
class that has theoverride
,mutate
andnoStateChange
methods is now calledChangeableState
and is the receiver in each DSL block instead of being passed as a parameter. Like beforeChangeableState
allows access to asnapshot
state. ...Effect
methods now have aState
class as receiver that allow accessingsnapshot
instead of receivingsnapshot
as a parameter.- It's now forbidden to access
snapshot
in theoverride
andmutate
methods to avoid accidental bugs where outdated state is used to build the new state.
Other:
...Effect
DSL methods won't cause the previous state to be emitted again when they complete.