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

StateFlow and CoroutineScope as constructor Parameter #130

Closed
sockeqwe opened this issue Jun 18, 2021 · 0 comments · Fixed by #150
Closed

StateFlow and CoroutineScope as constructor Parameter #130

sockeqwe opened this issue Jun 18, 2021 · 0 comments · Fixed by #150
Labels
enhancement New feature or request

Comments

@sockeqwe
Copy link
Collaborator

For FlowReduxStateMachine we should use StateFlow instead of Flow so that the StateMachine can work independent from it's state subscribers (like UI can subscribe and unsubscribe according to UI's lifecycle.

Furthemore, the statemachine should keep alive independent from subscribers lifecycle. Therefore a CoroutineScope should be passed as constructor parameter. That CoroutineScope will then be used to keep the whole statemachine alive until that scope gets canceled. On canceling this statemachine firther calls of dispatch() or state.collect() must throw an IllegalStateException.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant