Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin: add flow extension functions for BoxStore and Query #990

Merged
merged 2 commits into from Jun 15, 2021

Conversation

greenrobot-team
Copy link
Member

@greenrobot-team greenrobot-team commented Jun 8, 2021

Proposal to close #807

This will allow syntax like, for example to create a flow to listen to all changes to a box:

val flow = store.subscribe(TestEntity::class.java).toFlow()

Or to get the latest query results on any changes to a box:

val flow = box.query().subscribe().toFlow()

Also adds shortcuts if the subscription does not need to be customized:

val flow = store.flow(TestEntity::class.java)
val queryFlow = query.flow()

@greenrobot-team greenrobot-team added the enhancement New feature or request label Jun 8, 2021
@greenrobot-team greenrobot-team added this to the 2.9.2 milestone Jun 8, 2021
@greenrobot-team greenrobot-team linked an issue Jun 8, 2021 that may be closed by this pull request
@greenrobot-team greenrobot-team self-assigned this Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coroutine Flow support for objectbox
1 participant