subscribe

abstract fun CoroutineScope.subscribe(block: suspend Provider<S, I, A>.() -> Unit): Job

Subscribe to the store, obtaining a Provider to consume MVIStates and MVIActions. The store itself does not expose actions or states to prevent subscribers from affecting the store and to keep track of each subscription. When subscribe is invoked, a new StorePlugin.onSubscribe event is sent to all plugins with the new subscriber count. For more, see StorePlugin.