subscribe

fun subscribe(onAction: (action: A) -> Unit, onState: (state: S) -> Unit): AutoCloseable

Same as Store.subscribe but does not manage the scope for you. close the subscription job manually.

Return

an AutoCloseable that you can close when you want to unsubscribe from the store.