- MvRx now requires androidx.
- Fix: prevented duplicate subscriptions when subscriptions are made after onCreate. #210
- Respect uniqueOnly across configuration changes. #207
- This comes with additional code in BaseMvRxFragment. If you are not using BaseMvRxFragment, please refer to #207 for the additional required code.
- Remove state coalescing. #206
- Require that all MvRxViewModels actually provide a value for debugMode. #196
- BREAKING:
BaseMvRxViewModel
now requires the debug flag be explicitly set #196
(2019-1-16)
- Fix: mvrx-testing artifact now has the correct group name #184
(2019-1-14)
- New: Add app() to ViewModelFactoryContext. #179
- Fix: Prevent private state properties from crashing debug checks. #178
- Fix: Fix proguard docs and rules for new ViewModelFactory APIs. #181
(2019-1-11)
- BREAKING:
MvRxViewModelFactory
has been updated to provide more flexiblity when creating ViewModel and initial state #169:- Type signature changed from
MvRxFactory<S>
toMvRxFactory<VM, S>
for better type safety. - Changed signature of
MvRxViewModelFactory#create(activity: FragmentActivity, state: S) : VM
toMvRxViewModelFactory#create(viewModelContext: ViewModelContext, state: S) : VM?
.ViewModelContext
contains a reference to the owning activity and MvRx fragment arguments. For fragment scoped ViewModels, it will be of typeFragmentViewModelContext
with a reference to the creating fragment. These changes allow depedency injection of your ViewModel. - New: Added
MvRxViewModelFactory#initialState(viewModelContext: ViewModelContext) : S?
. This is useful if the initial state requires information not available inargs
. - New:
@JvmStatic
no longer required onMvRxViewModelFactory#create
and newMvRxViewModelFactory#initialState
.
- Type signature changed from
- Migration guide, required changes marked with
**
:
companion object : MvRxViewModelFactory<**RandomDadJokeViewModel**, RandomDadJokeState> {
** // No JvmStatic needed **
override fun create(viewModelContext: ViewModelContext, state: RandomDadJokeState): **RandomDadJokeViewModel** {
val service: DadJokeService by **viewModelContext.activity**.inject()
return RandomDadJokeViewModel(state, service)
}
}
- New: #154 Created
MvRxTestRule
inmvrx-testing
artifact to disable debug checks and change RxSchedulers. Add the test library:
dependencies {
testImplementation 'com.airbnb.android:mvrx-testing:0.7.0'
}
To use the rule, add the following to a test file:
class MyTest {
companion object {
@JvmField
@ClassRule
val mvrxTestRule = MvRxTestRule()
}
}
- New: Add
Completable#execute
#170 - Improved speed of saving and recreating state with
@PersistState
. #159 - Upgrade Kotlin to 1.3.11
- Upgrade to support lib 28.0.0 and fix bug when using 28.0.0 and restoring in a new process. #150
- Fix: Allow state arg constructors to accept subtypes #144.
(2018-10-23)
- New: Option to not re-emit the most recent state value when transitioning from stopped -> start. #113
- New: Add ScriptableStateStore interface for UI testing. #88
- New: Debug validation for state immutability #90
- New: selectSubscribe for 4-7 properties #125
- Fix: Execute no longer sets a default subscribeOn thread. #75
- Fix: Memory leaks. #110, #111
- Fix: Proper Proguard Rules. #78
- Fix: Multiple
setState
called within awithState
will execute in expected order. #89
(2018-08-28)
- Initial Open source release