to Flow
Like SubscriptionBuilder.observer, but emits data changes to the returned flow. Automatically cancels the subscription when the flow is canceled.
For example to create a flow to listen to all changes to a box:
store.subscribe(TestEntity::class.java).toFlow()Content copied to clipboard
Or to get the latest query results on any changes to a box:
box.query().subscribe().toFlow()Content copied to clipboard