New
2.0.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 calling before launching a state machine.