Adrian Witaszak02/13/2023, 11:08 PM
Casey Brooks02/13/2023, 11:20 PM
flag which defaults to
, and then flips to
after state restoration. Part of the MVI model is its async nature, so it’s not always possible to ensure things get processed fast enough to avoid things like this. The savedState restoration function was designed to allow for suspending save/restore, so keep that in mind. If your state restoration is truly synchronous, then setting those values in the
in the ViewModel configuration might be a better place to do it, which does ensure the first value emitted from the VM state has the values you expect. You’ll want to combine this with your own interceptor to save the state, though.