Download Latest Version 2.0.1 source code.tar.gz (374.5 kB)
Email in envelope

Get an email when there's a new version of FlowRedux

Home / 2.0.0
Name Modified Size InfoDownloads / 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 FlowReduxStateMachineFactory which can be started with launchIn/shareIn (Coroutines) or produceStateMachine (Compose). Both return an active FlowReduxStateMachine that allows dispatching actions to it and observing the current state.
  • The initial state of the FlowReduxStateMachineFactory is now provided by calling initializeWith { initialState }. Usually this is done in the init block 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 use initializeWith(reuseLastEmittedStateOnLaunch = false) { initialState }. There are also several overloads of initializeWith that allow to use SavedStateHandle to persist the previous state. It can also be used to change the initial state in tests by calling factory.initializeWith { testState } before launching a state machine.

DSL:

  • The State class that has the override, mutate and noStateChange methods is now called ChangeableState and is the receiver in each DSL block instead of being passed as a parameter. Like before ChangeableState allows access to a snapshot state.
  • ...Effect methods now have a State class as receiver that allow accessing snapshot instead of receiving snapshot as a parameter.
  • It's now forbidden to access snapshot in the override and mutate methods to avoid accidental bugs where outdated state is used to build the new state.
  • Added ExecutionPolicy.Throttled that 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 produceStateMachine which ships as part of the main library.
  • Added new artifact com.freeletics.flowredux2:flowredux-extensions:<version> which initially contains onEnterLoadSmoothly. 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 cancelOnState to onEnterStartStateMachine and onActionStartStateMachine
  • Added Logger and installLogger to allow logging of state changes and state machine events.
  • ...Effect DSL methods won't cause the previous state to be emitted again when they complete.
Source: README.md, updated 2025-11-25