Mavericks View
Functions
Subscribes to the given Flow within the coroutine scope of the subscriptionLifecycleOwner, starting the flow only when the lifecycle is started, and executing with the coroutine context of Mavericks' subscriptionCoroutineContextOverride. This can be utilized to create customized subscriptions, for example, to drop the first element in the flow before continuing. This is intended to be used with viewmodel.stateflow.
Override this to handle any state changes from MavericksViewModels created through MvRx Fragment delegates.
Subscribe to changes in an async property. There are optional parameters for onSuccess and onFail which automatically unwrap the value or error.
Subscribes to all state updates for the given viewModel.
Subscribes to state changes for only a specific property and calls the action with only that single property.
Subscribes to state changes for two properties.
Subscribes to state changes for three properties.
Subscribes to state changes for four properties.
Subscribes to state changes for five properties.
Subscribes to state changes for six properties.
Subscribes to state changes for seven properties.
Return a UniqueOnly delivery mode with a unique id for this fragment. In rare circumstances, if you make two identical subscriptions with the same (or all) properties in this fragment, provide a customId to avoid collisions.
Properties
Override this to supply a globally unique id for this MvRxView. If your MavericksView is being recreated due to a lifecycle event (e.g. rotation) you should assign a consistent id. Likely this means you should save the id in onSaveInstance state. The viewId will not be accessed until a subscribe method is called. Accessing mvrxViewId before calling super.onCreate() will cause a crash.
The LifecycleOwner to use when making new subscriptions. You may want to return different owners depending on what state your MavericksView is in.
Extensions
If any callbacks to run MavericksView.invalidate have been posted with MavericksView.postInvalidate then this cancels them.